123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715 |
- /**
- * consent
- */
- var mplus_mobile_consent = function(){
- mcare_mobile.call(this);
-
- var div = $("<div></div>");
- var tr = $("<tr></tr>");
- var th = $("<th></th>");
- var td = $("<td></td>");
- var table = $("<table></table>");
- var li = $("<li></li>");
- var a = $("<a></a>");
- var span = $("<span></span>");
-
-
- var $ulPatientList = $('#ulPatientList');
-
- var self = this;
-
- $serviceBaseUrl = contextPath + "/mobile";
- $hospitalServiceBaseUrl = contextPath + "/mobile/hospital";
- $consentServiceBaseUrl = contextPath + "/mobile/consent";
- this.hospital = {
- //부서리스트
- getDeptList : function(request){
- var deptList = [];
- $.ajax ({
- url : $hospitalServiceBaseUrl + '/getDeptList.json',
- type : 'POST',
- dataType: "json",
- contentType: "application/json",
- async: false,
- data: JSON.stringify(request),
- success: function(response){
- deptList = response.result;
- }
- });
- return deptList;
- },
-
- //의사리스트
- getDoctorList : function(request){
- var doctorList = [];
- $.ajax ({
- url : $hospitalServiceBaseUrl + '/getDoctorList.json',
- type : 'POST',
- dataType: "json",
- contentType: "application/json",
- async: false,
- data: JSON.stringify(request),
- success: function(response){
- doctorList = response.result;
- }
- });
- return doctorList;
- },
-
- //병동리스트
- getWardList : function(){
- var wardList = [];
- $.ajax ({
- url : $hospitalServiceBaseUrl + '/getWardList.json',
- type : 'POST',
- dataType: "json",
- contentType: "application/json",
- async: false,
- data: JSON.stringify({}),
- success: function(response){
- wardList = response.result;
- }
- });
- return wardList;
- },
-
- // 환자정보조회
- getPatientInfo : function(request){
- var patientInfoList = [];
- $.ajax ({
- url : $hospitalServiceBaseUrl + '/getPatientInfo.json',
- type : 'POST',
- dataType: "json",
- contentType: "application/json",
- async: false,
- data: JSON.stringify(request),
- success: function(response){
- if( response.msg != undefined ) {
- self.alert(response.msg);
- return;
- } else {
- patientInfoList = response.result;
- }
- }
- });
- return patientInfoList;
- }
- };
-
- this.patient = {
- //환자리스트 조회
- getPatientList : function(type, request, firstYn){
- var requestUrl = getPatientListUrl(type);
- // url이 안넘어왔을 때 (type을 잘못입력)
- if (requestUrl == undefined) {
- alert('잘못된 요청입니다.');
- return;
- };
- patientList = [];
- $ulPatientList.empty();
- $.ajax ({
- url : requestUrl,
- type : 'POST',
- dataType: "json",
- contentType: "application/json",
- beforeSend: function(){
- self.loading("show");
- },
- data: JSON.stringify(request)
- }).done(function(response){
- self.loading("hide");
- result = response.result
- patientList = result;
- if(firstYn!='Y'&&(result==undefined||result.length==0)) {
- self.loading("hide");
- self.alert('조회된 데이터가 없습니다.');
- return;
- };
- self.patient.setPatientList(type, result, "", "");
- });
- },
- setPatientList : function(type, list, sortKey, sortType, order){
- patientList = [];
- $ulPatientList.empty();
-
- result = sortKey==""? list: self.util.sortObj(list, sortKey, sortType, order);
- patientList = result;
-
- if(type=='I'){
- for(var i=0; i<result.length; i++){
- var aItem = a.clone().addClass("list-group-item").attr("seq", i);
- var divListRow = div.clone().addClass("list-row");
- var spanItem = span.clone().addClass("num").text(result[i].pid),
- spanItem2 = span.clone().addClass("name").text(result[i].deptnm),
- spanItem3 = span.clone().addClass("period").text(result[i].doctornm),
- divItem = divListRow.clone().html(spanItem).append(spanItem2).append(spanItem3);
-
- var spanItem4 = span.clone().addClass("num").text(result[i].sa),
- spanItem5 = span.clone().addClass("name").text(result[i].hngnm),
- spanItem6 = span.clone().addClass("period").text(result[i].roomcd),
- divItem2 = divListRow.clone().html(spanItem4).append(spanItem5).append(spanItem6);
- $ulPatientList.append(li.clone().html(aItem.clone().html(divItem).append(divItem2)).attr("id", "patient_"+i));
- };
- }else if(type=='O'){
- for(var i=0; i<result.length; i++){
- var aItem = a.clone().addClass("list-group-item").attr("seq", i);
- var divListRow = div.clone().addClass("list-row");
- var spanItem = span.clone().addClass("num").text(result[i].pid),
- spanItem2 = span.clone().addClass("name").text(result[i].deptnm),
- spanItem3 = span.clone().addClass("period").text(result[i].doctornm),
- divItem = divListRow.clone().html(spanItem).append(spanItem2).append(spanItem3);
-
- var spanItem4 = span.clone().addClass("num").text(result[i].sa),
- spanItem5 = span.clone().addClass("name").text(result[i].hngnm),
- divItem2 = divListRow.clone().html(spanItem4).append(spanItem5);
- $ulPatientList.append(li.clone().html(aItem.clone().html(divItem).append(divItem2)).attr("id", "patient_"+i));
- };
- }else if(type=='E'){
- for(var i=0; i<result.length; i++){
- var aItem = a.clone().addClass("list-group-item").attr("seq", i);
- var divListRow = div.clone().addClass("list-row");
- var spanItem = span.clone().addClass("num").text(result[i].pid),
- spanItem2 = span.clone().addClass("name").text(result[i].erorddeptnm),
- spanItem3 = span.clone().addClass("period").text(result[i].ermedispclnm),
- divItem = divListRow.clone().html(spanItem).append(spanItem2).append(spanItem3);
-
- var spanItem4 = span.clone().addClass("num").text(result[i].sa),
- spanItem5 = span.clone().addClass("name").text(result[i].hngnm),
- spanItem6 = span.clone().addClass("period").text(result[i].badcd),
- divItem2 = divListRow.clone().html(spanItem4).append(spanItem5).append(spanItem6);
- $ulPatientList.append(li.clone().html(aItem.clone().html(divItem).append(divItem2)));
- };
- }else if(type=='OP'){
- for(var i=0; i<result.length; i++){
- var aItem = a.clone().addClass("list-group-item").attr("seq", i);
- var divListRow = div.clone().addClass("list-row");
- var spanItem = span.clone().addClass("num").text(result[i].pid),
- spanItem2 = span.clone().addClass("name").text(result[i].deptnm),
- spanItem3 = span.clone().addClass("period").text(moment(result[i].opcnfmdd).format('YYYY/MM/DD')),
- divItem = divListRow.clone().html(spanItem).append(spanItem2).append(spanItem3);
-
- var spanItem4 = span.clone().addClass("num").text(result[i].sa),
- spanItem5 = span.clone().addClass("name").text(result[i].hngnm),
- spanItem6 = span.clone().addClass("period").text(result[i].oproomnm),
- divItem2 = divListRow.clone().html(spanItem4).append(spanItem5).append(spanItem6);
- $ulPatientList.append(li.clone().html(aItem.clone().html(divItem).append(divItem2)));
- };
- }else if(type=='SR'){
- for(var i=0; i<result.length; i++){
- var aItem = a.clone().addClass("list-group-item").attr("seq", i);
- var divListRow = div.clone().addClass("list-row");
- var spanItem = span.clone().addClass("num").text(result[i].pid),
- spanItem2 = span.clone().addClass("name").text(result[i].deptnm),
- spanItem3 = span.clone().addClass("period").text(result[i].doctornm),
- divItem = divListRow.clone().html(spanItem).append(spanItem2).append(spanItem3);
-
- var spanItem4 = span.clone().addClass("num").text(result[i].sa),
- spanItem5 = span.clone().addClass("name").text(result[i].hngnm),
- spanItem6 = span.clone().addClass("period").text(result[i].indd),
- divItem2 = divListRow.clone().html(spanItem4).append(spanItem5).append(spanItem6);
- $ulPatientList.append(li.clone().html(aItem.clone().html(divItem).append(divItem2)).attr("id", "patient_"+i));
- };
- };
- $('#ulPatientList .list-group-item').on("click", function(e){
- $('#ulPatientList a').removeClass('active');
- $(this).addClass('active');
- getPatientInfo(e.currentTarget.attributes.seq.value);
- });
- }
- };
-
- this.consent = {
- //동의서조회
- getConsentList : function(request){
- var consentList = [];
- $.ajax ({
- url : $consentServiceBaseUrl + '/getConsentList.json',
- type : 'POST',
- dataType: "json",
- contentType: "application/json",
- async: false,
- data: JSON.stringify(request),
- success: function(response){
- consentList = response.result;
- }
- });
- return consentList;
- },
-
- //동의서 검색
- getConsentBySearch: function(request){
- var consentList = [];
-
- $.ajax ({
- url : $consentServiceBaseUrl + '/getConsentBySearch.json',
- type : 'POST',
- dataType: "json",
- contentType: "application/json",
- async: false,
- data: JSON.stringify(request),
- success: function(response){
- consentList = response.result;
- }
- });
-
- return consentList;
- },
- //동의서 set조회
- getConsentSetList: function(request){
- var consentList = [];
-
- $.ajax ({
- url : $consentServiceBaseUrl + '/set/getConsentSetList.json',
- type : 'POST',
- dataType: "json",
- contentType: "application/json",
- async: false,
- data: JSON.stringify(request),
- success: function(response){
- consentList = response.result;
- }
- });
-
- return consentList;
- },
-
- //동의서 즐겨찾기 추가
- setUserFormSetList: function(request){
- var result = {};
- $.ajax ({
- url : $consentServiceBaseUrl + '/set/setUserFormSetList.json',
- type : 'POST',
- dataType: "json",
- contentType: "application/json",
- async: false,
- data: JSON.stringify(request),
- success: function(response){
- result = response.result;
- }
- });
-
- return result;
- },
-
- //동의서 즐겨찾기 삭제
- delUserFormSetList: function(request){
- var result = {};
- $.ajax ({
- url : $consentServiceBaseUrl + '/set/delUserFormSetList.json',
- type : 'POST',
- dataType: "json",
- contentType: "application/json",
- async: false,
- data: JSON.stringify(request),
- success: function(response){
- result = response.result;
-
- }
- });
-
- return result;
- },
-
- //동의서 삭제
- delConsent: function(request){
- var result = {};
- $.ajax ({
- url : $consentServiceBaseUrl+'/save/saveDelete.json',
- type : 'POST',
- contentType: "application/json",
- async: false,
- data: JSON.stringify(request),
- success: function(response){
- result = response.result;
- }
- });
- return result;
- },
-
- //ocr Tag 할당
- getOcrTag: function(){
- var result = '';
- $.ajax ({
- url : $consentServiceBaseUrl + '/getOcrTag.json',
- type : 'POST',
- dataType: "json",
- contentType: "application/json",
- data: JSON.stringify({}),
- async: false,
- success: function(response){
- result = response.result;
- }
- });
-
- return result;
- },
-
- //카테고리리스트 조회
- getCategoryForDropdown: function(request){
- var categoryList = [];
-
- $.ajax ({
- url : $consentServiceBaseUrl + '/getCategoryForDropdown.json',
- type : 'POST',
- dataType: "json",
- contentType: "application/json",
- async: false,
- data: JSON.stringify(request),
- success: function(response){
- categoryList = response.result;
- }
- });
-
- return categoryList;
- },
-
- //주치의별 동의서 검색
- getUnfinishedListPerDoctor: function(request){
- var consentList = [];
- $.ajax ({
- url : $consentServiceBaseUrl + '/getUnfinishedListPerDoctor.json',
- type : 'POST',
- dataType: "json",
- contentType: "application/json",
- async: false,
- data: JSON.stringify(request),
- success: function(response){
- consentList = response.result;
- }
- });
-
- return consentList;
- },
-
- // 동의서 이미지 정보 조회
- getConsentImage: function(request){
- var consentImageList = [];
-
- $.ajax ({
- url : $consentServiceBaseUrl + '/getConsentImage.json',
- type : 'POST',
- dataType: "json",
- contentType: "application/json",
- async: false,
- data: JSON.stringify(request),
- success: function(response){
- consentImageList = response.result;
- }
- });
-
- return consentImageList;
- },
-
- // 동의서 상태 체크
- checkConsentState: function(request){
- var state;
-
- $.ajax ({
- url : $consentServiceBaseUrl + '/checkConsentState.json',
- type : 'POST',
- dataType: "json",
- contentType: "application/json",
- async: false,
- data: JSON.stringify(request),
- success: function(response){
- state = response.result;
- }
- });
-
- return state;
- },
-
- makeConsentStateParam: function() {
- // 체크된 박스들
- var checkedStatus = $('.consentSearchBox input:checked[id!="chkboxConsentSign"]');
- // 체크된게 없으면 일단 이렇게 처리
- if( checkedStatus.length == 0 ) {
- self.alert('동의서 상태 조건을 선택하세요!');
- return;
- // 더이상 동의서 조회가 진행되지 않도록 하기
- }
- var consentStatus = '';
- for(var i = 0; i < checkedStatus.length; i++) {
- // 전체가 체크된 경우 뒤도 돌아보지않고 ALL만 리턴하도록
- if( checkedStatus[i].value == 'ALL') {
- consentStatus = checkedStatus[i].value;
- return consentStatus;
- } else {
- consentStatus = consentStatus + checkedStatus[i].value;
- }
- // 콤마 구분자 추가
- if(i != checkedStatus.length - 1) {
- consentStatus = consentStatus + ',';
- }
- }
- return consentStatus;
- },
-
- // 앱으로 넘겨줄 동의서 리스트 파라메터 만들기 - 작성중 기준
- makeConsentParam: function(patientInfo, consentList, userName) {
- // 유효성 검사 추가하기
- var consent = [];
- for( var i = 0; i < consentList.length; i++ ) {
- var unfinishedConsent = false;
- if( consentList[i].consentState == 'UNFINISHED' ) {
- unfinishedConsent = true;
- }
-
- var consentItem = {
- newConsent : unfinishedConsent? true: false,
- hospitalCretno: patientInfo.iocretNo,
- ward: patientInfo.ioward==null? "":patientInfo.ioward,
- roomNo: patientInfo.ioroomNo==null? "": patientInfo.ioroomNo,
- orderNo: consentList[i].orderNo,
- orderCd: consentList[i].orderCd==null?"":consentList[i].orderCd,
- IO_ocr_cd: consentList[i].ocrNumber==null?"":consentList[i].ocrNumber,
- consentCretno: consentList[i].cretno,
- outDate: patientInfo.iodschdd==null?"":patientInfo.iodschdd,
- mainDrId: patientInfo.iomaindrId==null?"":patientInfo.iomaindrId,
- consentState: consentList[i].consentState,
-
- rid: consentList[i].consentMstRid,
- IO_formname: consentList[i].consentName,
- IO_INPUTNM: userName,
- formCd: consentList[i].formCd,
- formRid: consentList[i].formRid,
-
- IO_Pt_ID: patientInfo.ioptID==null? "": patientInfo.ioptID,
- IO_sex_age_y_m: patientInfo.iosexAgeYM==null? "": patientInfo.iosexAgeYM,
- IO_Pt_name: patientInfo.ioptName==null? "": patientInfo.ioptName,
- IO_JuminNo: patientInfo.iojuminNo==null? "": patientInfo.iojuminNo,
- IO_PT_birthday: patientInfo.iojuminNo==null? "": patientInfo.iojuminNo.split('-')[0],
- IO_ADdate: patientInfo.ioaddate==null? "": moment(patientInfo.ioaddate).format('YYYY/MM/DD'),
- IO_Dept: patientInfo.iodeptNm==null? "": patientInfo.iodeptNm,
- IO_DeptCd: patientInfo.iodeptCd==null? "": patientInfo.iodeptCd,
- IO_OPdept: patientInfo.ioopdeptNm==null? "": patientInfo.ioopdeptNm,
- IO_OPdr: patientInfo.ioopdrNm==null? "": patientInfo.ioopdrNm,
- IO_Dx: patientInfo.iodxNm==null? "": patientInfo.iodxNm,
- IO_bp: patientInfo.iobp==null? "": patientInfo.iobp,
- IO_dm: patientInfo.iodm==null? "": patientInfo.iodm,
- IO_heart: patientInfo.ioheart==null? "": patientInfo.ioheart,
- IO_kidney: patientInfo.iokidney==null? "": patientInfo.iokidney,
- IO_respiration: patientInfo.iorespiration==null? "": patientInfo.iorespiration,
- IO_hx: patientInfo.iohx==null? "": patientInfo.iohx,
- IO_allergy: patientInfo.ioallergy==null? "": patientInfo.ioallergy,
- IO_drug: patientInfo.iodrug==null? "": patientInfo.iodrug,
- IO_smoking: patientInfo.iosmoking==null? "": patientInfo.iosmoking,
- IO_idio: patientInfo.ioidio==null? "": patientInfo.ioidio,
- IO_nacrotics: patientInfo.ionacrotics==null? "": patientInfo.ionacrotics,
- IO_airway: patientInfo.ioairway==null? "": patientInfo.ioairway,
- IO_hemorrhage: patientInfo.iohemorrhage==null? "": patientInfo.iohemorrhage,
- IO_status_etc: patientInfo.iostatusEtc==null? "": patientInfo.iostatusEtc
- }
-
- if( unfinishedConsent ) {
- consentItem.guid = consentList[i].formGuid;
- }
-
- if(consentItem.ward.length > 0 && consentItem.roomNo.length > 0) {
- consentItem.IO_roomNo = consentItem.ward + '/' + consentItem.roomNo;
- } else {
- consentItem.IO_roomNo = "";
- }
-
- // 외래>소화기내과인 경우 시술의,수술의 설정. 2017/1/3 고객요구사항
- if(patientInfo.iovisitType == 'O' && patientInfo.iodeptCd == '2010300000') {
- consentItem.IO_OPdr = patientInfo.iomaindrNm;
- }
- consent.push(consentItem);
- }
-
- return consent;
- },
-
- // 앱으로 넘겨줄 동의서 리스트 파라메터 만들기 - 신규 기준
- makeNewConsentParam: function(patientInfo, consentList, userName) {
- // 유효성 검사 추가하기
- var consent = [];
- //ocrTagYn체크해서 넣어주기
- for( var i = 0; i < consentList.length; i++ ) {
- var ocrtag = "";
- //if(consentList[i].printOnly=="N"){ //전부 N일테니 조건따위 필요하지않아!!*/
- ocrtag = this.getOcrTag().text;
- //}
- var consentItem = {
- newConsent : true,
- hospitalCretno: patientInfo.iocretNo,
- ward: patientInfo.ioward==null? "":patientInfo.ioward,
- roomNo: patientInfo.ioroomNo==null? "": patientInfo.ioroomNo,
- IO_ocr_cd: ocrtag,
- outDate: patientInfo.iodschdd==null?"":patientInfo.iodschdd,
- mainDrId: patientInfo.iomaindrId==null?"":patientInfo.iomaindrId,
- guid: consentList[i].formGuid,
- IO_formname: consentList[i].formName,
- IO_INPUTNM: userName,
-
- formCd: consentList[i].formCd,
- formRid: consentList[i].formRid,
-
- IO_Pt_ID: patientInfo.ioptID==null? "": patientInfo.ioptID,
- IO_sex_age_y_m: patientInfo.iosexAgeYM==null? "": patientInfo.iosexAgeYM,
- IO_Pt_name: patientInfo.ioptName==null? "": patientInfo.ioptName,
- IO_JuminNo: patientInfo.iojuminNo==null? "": patientInfo.iojuminNo,
- IO_PT_birthday: patientInfo.iojuminNo==null? "": patientInfo.iojuminNo.split('-')[0],
- IO_roomNo: patientInfo.ioroomNo==null? "": patientInfo.ioroomNo,
- IO_ADdate: patientInfo.ioaddate==null? "": moment(patientInfo.ioaddate).format('YYYY/MM/DD'),
- IO_Dept: patientInfo.iodeptNm==null? "": patientInfo.iodeptNm,
- IO_DeptCd: patientInfo.iodeptCd==null? "": patientInfo.iodeptCd,
- IO_OPdept: patientInfo.ioopdeptNm==null? "": patientInfo.ioopdeptNm,
- IO_OPdr: patientInfo.ioopdrNm==null? "": patientInfo.ioopdrNm,
- IO_Dx: patientInfo.iodxNm==null? "": patientInfo.iodxNm,
- IO_bp: patientInfo.iobp==null? "": patientInfo.iobp,
- IO_dm: patientInfo.iodm==null? "": patientInfo.iodm,
- IO_heart: patientInfo.ioheart==null? "": patientInfo.ioheart,
- IO_kidney: patientInfo.iokidney==null? "": patientInfo.iokidney,
- IO_respiration: patientInfo.iorespiration==null? "": patientInfo.iorespiration,
- IO_hx: patientInfo.iohx==null? "": patientInfo.iohx,
- IO_allergy: patientInfo.ioallergy==null? "": patientInfo.ioallergy,
- IO_drug: patientInfo.iodrug==null? "": patientInfo.iodrug,
- IO_smoking: patientInfo.iosmoking==null? "": patientInfo.iosmoking,
- IO_idio: patientInfo.ioidio==null? "": patientInfo.ioidio,
- IO_nacrotics: patientInfo.ionacrotics==null? "": patientInfo.ionacrotics,
- IO_airway: patientInfo.ioairway==null? "": patientInfo.ioairway,
- IO_hemorrhage: patientInfo.iohemorrhage==null? "": patientInfo.iohemorrhage,
- IO_status_etc: patientInfo.iostatusEtc==null? "": patientInfo.iostatusEtc
- }
-
- if(consentItem.ward.length > 0 && consentItem.roomNo.length > 0) {
- consentItem.IO_roomNo = consentItem.ward + '/' + consentItem.roomNo;
- } else {
- consentItem.IO_roomNo = "";
- }
-
- // 외래>소화기내과인 경우 시술의,수술의 설정. 2017/1/3 고객요구사항
- if(patientInfo.iovisitType == 'O' && patientInfo.iodeptCd == '2010300000') {
- consentItem.IO_OPdr = patientInfo.iomaindrNm;
- }
-
- consent.push(consentItem);
- }
-
- return consent;
- },
-
- // 앱으로 넘겨줄 global 파라메터 만들기
- makeGlobalParam: function(patientInfo, signDoctorId) {
- // 유효성 검사 추가하기
- if(patientInfo == undefined) return;
-
- // 현재 일시 계산
- var currentTime = new Date();
- var timeText = dateTimeFormat(currentTime);
-
- var param = {userid : signDoctorId};
- var result = this.getSignImage(param);
- var signImage = '';
-
- if(result != undefined) {
- if(result.signImage != null && result.signImage != '') {
- signImage = result.signImage;
- }
- }
-
- var global = {
- IO_device: "M",
- visitType: patientInfo.iovisitType,
- IO_signdate: timeText,
- IO_signtime: timeText,
- IO_printtime: timeText,
- IO_maindr: patientInfo.iomaindrNm==null? "": patientInfo.iomaindrNm,
- IO_SIGNIMG: signImage
- }
-
- // 응급일 경우 ioerdrNm에 실제 주치의가 들어오기때문에 이걸로 변경해줌.
- if( patientInfo.ioerdrNm != null) {
- global.IO_maindr = patientInfo.ioerdrNm;
- }
-
- return global;
- },
-
- // 의사 서명 이미지 정보 조회
- getSignImage : function(request){
- var signImage;
- $.ajax ({
- url : $hospitalServiceBaseUrl + '/getSignImage.json',
- type : 'POST',
- dataType: "json",
- contentType: "application/json",
- async: false,
- data: JSON.stringify(request),
- success: function(response){
- signImage = response.result;
- }
- });
- return signImage;
- }
- };
-
- // 환자리스트 URL 리턴
- // 입원: I, 외래: O, 응급: E, 수술: OP, 검색: SR
- function getPatientListUrl(type) {
- switch (type) {
- case 'I' :
- return $serviceBaseUrl + '/in/getInPatList.json';
- case 'O' :
- return $serviceBaseUrl + '/out/getOutPatList.json';
- case 'E' :
- return $serviceBaseUrl + '/er/getErPatList.json';
- case 'OP' :
- return $serviceBaseUrl + '/op/getOpPatList.json';
- case 'SR' :
- return $serviceBaseUrl + '/search/getSrPatList.json';
- default:
- return;
- }
- }
-
- function dateTimeFormat(date) {
- try{
- var yyyy = date.getFullYear().toString(),
- mm = (date.getMonth()+1).toString(),
- dd = date.getDate().toString(),
- hh = date.getHours().toString(),
- mi = date.getMinutes().toString(),
- ss = date.getSeconds().toString(),
-
- text = yyyy + "-" + (mm[1]?mm:"0"+mm[0]) + "-" + (dd[1]?dd:"0"+dd[0]) + " "
- + (hh[1]?hh:"0"+hh[0]) + ":" + (mi[1]?mi:"0"+mi[0]) + ":" + (ss[1]?ss:"0"+ss[0]) ;
-
-
- return text;
- } catch(e) {
- self.log(e, "mcare_util_simpleDateFormat" );
- }
- }
- };
- //환자 나이정보 리턴
- function editAgeToIdNum(idNum){
- var sex = '';
- var ageYm = '';
- var age = '';
- //성별과 나이 분리
- if(idNum.indexOf('/')>0){
- sex = idNum.split('/')[0];
- ageYm = idNum.split('/')[1];
- }else{
- ageYm = idNum;
- };
- //나이 가공
- if(ageYm.indexOf('y')>0){
- age = ageYm.split('y')[0];
- }else if(ageYm.indexOf('m')>0||ageYm.indexOf('d')>0){
- age = 0;
- }else{
- age = ageYm;
- };
-
- return sex + '/' + age;
- };
|