123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937 |
- <?xml version="1.0" encoding="utf-8"?>
- <Script type="xscript4.0"><![CDATA[/**
- * SMMMR01003.js
- * SMMMR01003_BriefOpNoteJCI.xrw
- * -> 신규작성시 수술간호에서 수술정보를 조회해옴(asis는 기존의 brief기록정보를 로딩했음)
- */
-
- var arrItemCds = new Array(
- "0000515001"//수술일자
- , "0000980001"//집도의
- , "0000341001"//보조의
- , "0007983001"//수술전진단명
- , "0000521001"//수술후진단명
- , "0000509001"//수술명
- , "0000248001"
- // , "0000248.0015528"//마취종류(주) //0000248.0015528
- // , "0000248.0008458"//마취종류(부) //0000248.0008458
- , "0000512001"//OP Findings & Procedure
- , "0022906001"//출혈정도
- , "0008331001"//조직검사
- , "0000323001"//배액
- , "0036148001"//특이사항
- , "0001115001"//특이사항
- );
- //부분서식의 부모아이템 배열
- var gItemCds = new Array(
- "0007983001"//수술전진단명
- , "0000521001"//수술후진단명
- , "0000509001"//수술명
- , "0000512001"//OP Findings & Procedure
- , "0022906001"//출혈정도
- );
- var gItemCdsTextArea = new Array(
- "0000512001"//OP Findings & Procedure
- , "0022906001"//출혈정도
- );
- var gItemCdsXRWArea = new Array(
- "0007983001"//수술전진단명
- , "0000521001"//수술후진단명
- , "0000509001"//수술명
- , "0022906001"//출혈정도
- );
- //부분서식의 개수만큼 일단 '0'으로 채운다.
- var gPageIdx = new Array(0, 0);
- var iSurg = grup_base.ipt_surg.degnitemlevlcd;
- var iMcdnm = grup_base.ipt_mcdnm.degnitemlevlcd;
- var iScdnm = grup_base.ipt_scdnm.degnitemlevlcd;
- var operation = sysf_getGlobalVariable("operation").split("▩")[1];
- var pageInfo = new PAGEINFO();
- var oprsrvno = ""; //수술예약번호
- var perfdeptcd = ""; //집도과
- if(!utlf_isNull(operation)){
- oprsrvno = operation.split("▦")[0];
- perfdeptcd = operation.split("▦")[10];
- }
- /**
- * @desc : 확장버튼(이미지,가계도,추가기록)을 기록여부에 따라 표시를 위한 버튼목록
- * @id :
- * @authur : 안치원
- * @history : 2009.09.09 신규 안치원 ACW_090909A
- */
- var gExtnBtnIds = new Array(
- "btn_imge_0000512001" //OP Findings & Procedure 이미지버튼
- , "btn_etcrec_0000512001" //OP Findings & Procedure 추가기록버튼
- );
- var lodedYn = false;
- /****************************************************************************************
- * Function : fClearComnFormData
- * Description : 서식 데이터 Clear, 인터페이스 입력값 조회 입력
- ****************************************************************************************/
- function fClearComnFormData()
- {
- if (!utlf_isNull(gMaxSectionID))
- {
- frmf_inputEnterKey( "ComnFormObj.lbl_"+gMaxSectionID, "onclick", new ClickEventInfo);
- }
- sysf_trace("lodedYn : " + lodedYn );
- if( lodedYn == true )
- //ClearComnFormData(gItemCds);
-
- fInitialize();
-
- if (parent.fGetFormRec("status") == "C")
- {
- }
-
- //포커스 처리
- SetDefFocusIVW(gItemCdsTextArea);
- }
- /****************************************************************************************
- * Function : fLoadData
- * Description : 기록데이터 조회
- ****************************************************************************************/
- function fLoadData()
- {
- fInitialize();
-
- lf_setRecData(arrItemCds);
-
- var sStatus = fGetFormRec("status");
- lf_setBasicInfo(sStatus);
-
- // //Program 서식 데이터 조회반영
- // InitPgmFormData();
- // this.recRef2 = "/root/hidden/recinfo"
- // //부분서식 데이터 조회 반영
- // InitUnitFormData(gItemCds);
- }
- /****************************************************************************************
- * Function : fInitialize
- * Description : 화면 초기화
- ****************************************************************************************/
- function fInitialize()
- {
- gTermViewTopPos = 27;
- gTermViewHei = 307;//152
- gTermViewItems = gItemCdsXRWArea;
- }
- /****************************************************************************************
- * Function : fPatientHist
- * Description : 수술이력 팝업
- ****************************************************************************************/
- function fPatientHist()
- {
- frmf_modal("SMMMO02500", "SMMMO02500", null, null, null, null, null, null, null, null, null, null, "M");
- }
- /****************************************************************************************
- * Function : fSetRecItemValue
- * Description : 기록 인스턴스 연결
- ****************************************************************************************/
- function fSetRecItemValue(reciteminfo)
- {
- return SetCommMediFormValue(gItemCds, reciteminfo);
- }
- /****************************************************************************************
- * Function : fSetSizeFormDiag
- * Description : 수술전 진단명 사이즈 조절
- ****************************************************************************************/
- function fSetSizeFormDiag()
- {
- grup_base.ivw_0007983001.fInitPage(false, parseInt(grup_base.ivw_0007983001.position.height), parseInt(grup_base.ivw_0007983001.position.width), "ivw_0007983001", "수술전 진단명(Free text)");
- }
- /****************************************************************************************
- * Function : fSetSizeFormDiag1
- * Description : 수술후 진단명 사이즈 조절
- ****************************************************************************************/
- function fSetSizeFormDiag1()
- {
- grup_base.ivw_0000521001.fInitPage(false, parseInt(grup_base.ivw_0000521001.position.height), parseInt(grup_base.ivw_0000521001.position.width), "ivw_0000521001", "수술후 진단명(Free text)");
- }
- /****************************************************************************************
- * Function : fSetSizeFormOpr
- * Description : 서식 수술명 사이즈 조절
- ****************************************************************************************/
- function fSetSizeFormOpr()
- {
- grup_base.ivw_0000509001.fInitPage(false, parseInt(grup_base.ivw_0000509001.position.height), parseInt(grup_base.ivw_0000509001.position.width), "ivw_0000509001");
- }
- /*****************************************************************************
- 튜닝
- ******************************************************************************/
- var gLoadFormCnts = 0;
- /****************************************************************************************
- * Function : fFormReady
- * Description : 화면 로딩후 초기화 작업 수행
- ****************************************************************************************/
- function fFormReady()
- {
- this.ComnFormObj = this.grup_base;
- dsf_createDsRow("ds_temp_mainrecitem",
- [{col:"formxrw", val:""}]);
- // 공통서식의 초기 recitem 정보. 기록 데이터 조합시 사용
- ds_temp_mainrecitem.assign(ds_data_recitem);
-
- lf_setSectionSize(gItemCds, "grup_base.tar_0000512001", "grup_base.tar_0022906001", 294);
- //20080702 박종훈 추가
- fInitialize();
- InitBtnImge(gItemCdsTextArea);
- InitBtnEtcRec(gItemCdsTextArea);
- // InitBtnComn(gItemCdsTextArea);
- // dispOnLoadComplete(COMN_FORM);
- // lf_checkUnitForm(gItemCds); // 부분서식 로딩
- lf_AllLoadUnitFormExpand(gItemCds); // 전체 로드
-
-
- lf_setRecData(gItemCds);
-
- if (parent.fGetFormRec("status") == "C")
- {
- //20091211 dhkim 추가(수술과정 캡션 visible/hidden처리)
- if( lodedYn == true )
- fViewOPfindingsCaption_SMMMR01001("0000512001");
- else
- this.setTimer(1003, 500);
- }
-
- }
- /****************************************************************************************
- * Function : fLoadUnitForm
- * Description : 부분서식 로딩
- ****************************************************************************************/
- function fLoadUnitForm()
- {
- initSection(gItemCds);
- }
- var diagcnt = 0;
- /****************************************************************************************
- * Function : fOnLoadComplete
- * Description : 부분서식 로딩후 후처리
- ****************************************************************************************/
- function fOnLoadComplete()
- {
- var rtn = false;
- var curLoadFormCd = frmf_getParameter("loadformcd");
- frmf_setParameter("loadformcd", "");
-
- var nFindRow = ds_data_unitformmast.findRowExpr("formcd=='" + curLoadFormCd + "' && loaded != 'true'");
- var fstLevlItemCd = ds_data_unitformmast.getColumn(nFindRow, "orgsupdegnitemcd");
- var ivwObj = ComnFormObj.components["ivw_" + fstLevlItemCd];
- var unitformload = ds_data_unitformmast.getColumn(nFindRow, "loaded");
-
- if(!utlf_isNull(ivwObj) && unitformload != "true")
- {
- //setFstLevlItemCd(ivwObj, curLoadFormCd);
- var nRow = ds_data_unitformmast.findRow("formcd", curLoadFormCd);
- ds_data_unitformmast.setColumn(nRow, "loaded", "true");
- }
-
- //수술전진단명 부분서식 로딩후 처리
- if(fstLevlItemCd == '0007983001')
- {
- fSetSizeFormDiag();
- }
- //수술후진단명 부분서식 로딩후 처리
- if(fstLevlItemCd == '0000521001')
- {
- fSetSizeFormDiag1();
- }
- //수술명 부분서식 로딩후 처리
- if(fstLevlItemCd == '0000509001')
- {
- fSetSizeFormOpr();
-
- if (parent.fGetFormRec("status") == "C")
- {
- fClearComnFormData();
- }
- }
- gLoadFormCnts++;
- utlf_addLog("@@@@@ gItemCds.length : " + gItemCds.length + " gLoadFormCnts : " + gLoadFormCnts );
- if(gItemCds.length == gLoadFormCnts)
- {
- //fSetOprInfo();
- dispOnLoadComplete(UNIT_FORM);
-
- //서식 로딩 후 포커스 처리(2008-11-18 박종훈)
- SetDefFocusIVW(gItemCdsTextArea);
-
- //2010.01.11 dhkim - 마지막로딩후 수술일자 disable처리
- //ComnFormObj.ipt_surg.enable = false;
- }
- }
- /****************************************************************************************
- * Function : fGetDefData
- * Description : 동일 서식이 떠있을 경우 내부 인스턴스 로딩 후 디폴트 조회내용 조회
- ****************************************************************************************/
- function fGetDefData()
- {
- fSetSizeFormOpr();
-
- operation = sysf_getGlobalVariable("operation").split("▩")[1];
-
- if(!utlf_isNull(operation)){
- oprsrvno = operation.split("▦")[0];
- perfdeptcd = operation.split("▦")[10];
- }
-
- dispOnLoadComplete(UNIT_FORM);
- }
-
- /****************************************************************************************
- * Function : fRadioYN
- * Description : 라디오버튼 선택에 따른 reccnts셋팅
- ****************************************************************************************/
- function fRadioYN(obj:Radio, e:ItemChangeEventInfo)
- {
- var sDegnitemlevlcd = obj.degnitemlevlcd;
- var nFindRow = ds_data_recitem.findRow("degnitemlevlcd", sDegnitemlevlcd);
- if(nFindRow == -1)
- {
- nFindRow = ds_data_recitem.addRow();
- var insRow = ds_temp_mainrecitem.findRow("degnitemlevlcd", sDegnitemlevlcd);
- ds_data_recitem.copyRow(nFindRow, ds_temp_mainrecitem, insRow);
- }
- var sRectermnm = parent.ds_data_vallist.getColumn(parent.ds_data_vallist.findRow("valcd", e.postvalue), "valitemnm");
- if( utlf_isNull(sRectermnm) ) sRectermnm = e.posttext;
- ds_data_recitem.setColumn(nFindRow, "rectermcd", e.postvalue);
- ds_data_recitem.setColumn(nFindRow, "rectermnm", sRectermnm);
- }
- /**
- * @desc : 수술예약번호를 통한 진단명, 마취종류 조회
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fGetdiagFormOprsrvno(oprsrvno, iMcdnm, iMcdnm, iScdnm, iScdnm)
- {
- if(oprsrvno != ""){
- model.removeNodeset("/root/main/diaginfo/diagcdlist");
- model.removenode("/root/send");
- model.makeValue("/root/send/oprsrvno", oprsrvno);
- //model.makeValue("/root/send/oprsrvno", "2007000009");
- submit("TRMRF04001", false);
- var anstmthdcd = model.getValue("/root/main/diaginfo/anstlist/anstmthdcd");
- var mcdnm = model.getValue("/root/main/diaginfo/anstlist/mcdnm");
- var anstmthdcdsub = model.getValue("/root/main/diaginfo/anstlist/anstmthdcdsub");
- var scdnm = model.getValue("/root/main/diaginfo/anstlist/scdnm");
- var pageInfo = new PAGEINFO();
- var iptMObj = document.controls("ipt_mcdnm");
- var iptSObj = document.controls("ipt_scdnm");
-
- if (anstmthdcd != "" && mcdnm != "")
- {
- //주마취
- model.setValue("/root/main/recinfo/recitem[degnitemlevlcd='" + iMcdnm + "']/rectermcd", anstmthdcd);
- model.setValue("/root/main/recinfo/recitem[degnitemlevlcd='" + iMcdnm + "']/rectermnm", mcdnm);
-
- iptMObj.attribute("ref") = pageInfo.recItemRef + "[degnitemlevlcd='" + iMcdnm + "']/rectermnm";
- }
- else
- {
- iptMObj.attribute("ref") = pageInfo.recItemRef + "[degnitemlevlcd='" + iMcdnm + "']/reccnts";
- }
-
- if (anstmthdcdsub != "" && scdnm != "")
- {
- //부마취
- model.setValue("/root/main/recinfo/recitem[degnitemlevlcd='" + iScdnm + "']/rectermcd", anstmthdcdsub);
- model.setValue("/root/main/recinfo/recitem[degnitemlevlcd='" + iScdnm + "']/rectermnm", scdnm);
-
- iptSObj.attribute("ref") = pageInfo.recItemRef + "[degnitemlevlcd='" + iScdnm + "']/rectermnm";
- }
- else
- {
- iptSObj.attribute("ref") = pageInfo.recItemRef + "[degnitemlevlcd='" + iScdnm + "']/reccnts";
- }
- copyNodeset("/root/main/diaginfo/diagcdlist", "/root/main/diaginfo/diagcdlist", "replace", ivw_0007983001.model, model);
- copyNodeset("/root/main/diaginfo/diagcdlist", "/root/main/diaginfo/diagcdlist", "replace", ivw_0000521001.model, model);
- model.refresh();
- ivw_0007983001.window.javascript.fSetDiagNmInstance();
- ivw_0000521001.window.javascript.fSetDiagNmInstance();
- return true;
- }else{
-
- messageBox("수술예약이 되지 않은 환자이거나 수술탭에서 선택하지 않은", "I005");
- grup_base.disabled = true;
- fBtnDisEnable(true);
- return false;
- }
- }
- /****************************************************************************************
- * Function : fBtnDisEnable
- * Description : 저장버튼 Disable
- ****************************************************************************************/
- function fBtnDisEnable(flag)
- {
- if(flag)
- {
- parent.fDisalbeSave(flag);
- }
- else
- {
- parent.fDisalbeSave(flag);
- }
- }
- /**
- * @desc : 수술명, 집도의 조회
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSrchOprPerfDrlist(oprsrvno, cOdt1)
- {
- model.removeNodeset("/root/tmpop/selectoplist");
- model.removeNodeset("/root/main/paminfo/list");
- var node = getGlobalVariable("paminfo");
- if(node != "" && node != null){
- setCSVToNode("/root/main/paminfo", node);
-
- model.removenode("/root/send");
- model.makeValue("/root/send/pid", model.getValue("/root/main/paminfo/list/pid"));
- model.makeValue("/root/send/cretno", model.getValue("/root/main/paminfo/list/cretno"));
- if (model.getValue("/root/main/paminfo/list/ioflag") == "O")
- {
- model.makeValue("/root/send/orddd", model.getValue("/root/main/paminfo/list/orddd"));
- }
- else
- {
- model.makeValue("/root/send/orddd", model.getValue("/root/main/paminfo/list/indd"));
- }
- model.makeValue("/root/send/oprsrvno", oprsrvno);
- model.makeValue("/root/send/srchmode", "dr");
- //model.removeNodeset("/root/main/recinfo/recitem[degnitemno = '1']");
-
- // alert("TRMRF04301서브밋전 oprsrvno:" + oprsrvno);
- if (submit("TRMRF04301"))
- {
- copyNodeset("/root/tmpop/selectoplist", "/root/tmpop/selectoplist", "replace", ivw_0000509001.model, model);
- ivw_0000509001.window.javascript.fAfterSrch();
- }
- //조회해온 수술일자, 수술시간으로 iviewer 상단 진료일자 변경
- if (submit("TRMRF04302"))
- {
- var perfdrnm = model.getValue("/root/tmp/perfdr/perfdrnm");
- var opfromdt = model.getValue("/root/tmp/perfdr/opfromdt");
-
- var sOpDrList = model.instances(0).selectNodes("/root/main/infstrec/recitem[fstlevlitemcd='0000341001']");
-
-
- var opstdd = opfromdt.substring(0, 8);
- var opsttm = opfromdt.substring(8, 12);
-
- //2010.02.03 dhkim - 수술기록 없을때 현재일자세팅하지 않음
- /*
- if (opstdd == "" || opstdd.length < 8)
- {
- opstdd = getCurrentDate();
- }
- */
-
- if (opsttm == "" || opsttm.length < 4)
- {
- opsttm = getCurrentTime().substr(0, 4);
- }
-
- //var transopdd = opstdd.substr(0, 4) + "-" + opstdd.substr(4, 2) + "-" + opstdd.substr(6, 2)
-
- //2010.02.03 dhkim - 수술기록 있을때만 일자세팅
- if(opstdd != "" && opstdd.length == 8){
- parent.window.javascript.fSetFormRec("formrecdd" , opstdd);
- parent.window.javascript.fSetFormRec("formrechm" , opsttm);
- parent.ipt_formrecdd.refresh();
- parent.ipt_formrectm.refresh();
- }
-
- opstdd = parent.window.javascript.fGetFormRec("formrecdd");
-
- model.setValue("/root/main/recinfo/recitem[degnitemlevlcd='" + iSurg + "']/reccnts", opstdd); //수술일
- model.setValue(pageInfo.recItemRef + "[degnitemlevlcd=0000980]/reccnts", perfdrnm); //집도의
- }
- /*
- //dhkim
- //보조의 조회해 text에 이름세팅
- model.removenode("/root/send");
- parent.window.javascript.fSetFormRec("oprsrvno", oprsrvno);
- model.makeValue("/root/send/reqinfstrec/pid", parent.window.javascript.fGetPamInfo("pid"));
- model.makeValue("/root/send/reqinfstrec/orddd", parent.window.javascript.fGetPamInfo("indd"));
- model.makeValue("/root/send/reqinfstrec/cretno", parent.window.javascript.fGetPamInfo("cretno"));
- model.makeValue("/root/send/reqinfstrec/oprsrvno", oprsrvno);
-
- if(submit('TRMMR01003')){
-
- //보조의
- var sOpDrList = model.instances(0).selectNodes("/root/main/infstrec/recitem[fstlevlitemcd='0000341001']");
- var sOpdegnitemlevlcd = "";
- var sOprectermcd = "";
- var sOprectermnm = "";
- var sOpreccnts = "";
- var sOpdegnitemnm = "";
- var sOpdegnitemkind = "";
- var sOprecrslt = "";
-
- for(var i = 0; i < sOpDrList.length; i++)
- {
- sOpdegnitemlevlcd = sOpDrList.item(i).selectSingleNode("degnitemlevlcd").text;
- sOprectermcd = sOpDrList.item(i).selectSingleNode("rectermcd").text;
- sOprectermnm = sOpDrList.item(i).selectSingleNode("rectermnm").text;
- sOpreccnts = sOpDrList.item(i).selectSingleNode("reccnts").text;
- sOpdegnitemnm = sOpDrList.item(i).selectSingleNode("degnitemnm").text;
- sOpdegnitemkind = sOpDrList.item(i).selectSingleNode("degnitemkind").text;
-
- if (sOprectermnm != "" && sOprecrslt == "")
- {
- sOprecrslt += sOprectermnm;
- }
- else if(sOprectermnm != "")
- {
- sOprecrslt += ", " + sOprectermnm;
- }
- else if(sOpreccnts != "")
- {
- sOprecrslt += ", " + sOpreccnts;
- }
- }
- //보조의
- model.setValue(pageInfo.recItemRef + "[degnitemlevlcd=0000980]/reccnts", perfdrnm);
- model.setValue(pageInfo.recItemRef + "[degnitemlevlcd=0000341]/reccnts", sOprecrslt);//보조의
-
- }
- */
- model.refresh();
- }
- }
- /****************************************************************************************
- * Function : fViewOPfindingsCaption_SMMMR01001
- * Description : OP Findings & Procedure에 데이터가 없을때 캡션을 보여준다.
- ****************************************************************************************/
- function fViewOPfindingsCaption_SMMMR01001(itemcd){
- if(itemcd == '0000512001'){//OP Findings & Procedure
-
- var tarid = ComnFormObj.components["tar_" + itemcd];
- var ivwid = ComnFormObj.components["ivw_" + itemcd];
- var capid = ComnFormObj.components["cap_" + itemcd];
- var tarVal = "";
-
- if(!utlf_isNull(ivwid) && !utlf_isNull(ivwid.url) && lodedYn == true){
- //tarVal = ivwid.ds_data_recitem.lookup("fstlevlitemcd", itemcd, "reccnts");
- tarVal = ivwid.ds_data_itemvalue.getColumn(0, "MTX_1");
- }
-
- if(utlf_isNull(tarVal)){
- capid.visible = true;
- tarid.visible = false;
- ivwid.visible = false;
- capid.bringToFront();
- }else{
- capid.visible = false;
- if( !utlf_isNull(ivwid) && !utlf_isNull(ivwid.url) ){
- tarid.visible = false;
- ivwid.visible = true;
- ivwid.bringToFront();
- }else{
- tarid.visible = true;
- ivwid.visible = false;
- tarid.bringToFront();
- }
- }
-
- }
-
- }
- /****************************************************************************************
- * Function : initFormAtLast_MMR01100I
- * Description : MMR01100.js에서 서식load를 완료한 후에 호출한다.
- ****************************************************************************************/
- function initFormAtLast_MMR01100I() {
-
- var formcd = parent.fGetFormMast("formcd");
-
- // XP 주석처리
- //fInitAnstTypeCtrl_MMR01001();//2010.01.18 dhkim - 콤보바인딩 후 연동데이터 세팅하도록 순서변경
-
- //신규서식로딩의 경우 && 진단 grid에 데이터 없을때만 Brief Op Note 연동
- // var nodesetCnt = getNodesetCnt(ivw_0007983001.model, ivw_0007983001.grd_diaglist.nodeset); //진단
- // if (nodesetCnt == 0 && parent.window.javascript.fGetFormRec("status") == "C") {
- if (parent.fGetFormRec("status") == "C") {
-
- var operation = sysf_getGlobalVariable("operation").split("▩")[1];
- var oprsrvno = "";
- if(!utlf_isNull(operation)){
- oprsrvno = operation.split("▦")[0];
- }
-
- //수술예약번호 체크
- if(utlf_isNull(oprsrvno))
- {
- sysf_messageBox("수술예약이 되지 않은", "I005");
- grup_base.enable = false;
- parent.initButtonLayer_MMR01100("no_auth");
- } else {
- parent.fSetFormRec("oprsrvno", oprsrvno);
-
- grup_base.enable = true;
- parent.initButtonLayer_MMR01100("staff_auth_n");
- }
-
- fGetRecIfData_MMR01001("opr;opdiag;opnm");
- } else {
- grup_base.enable = true;
- parent.initButtonLayer_MMR01100("staff_auth_n");
- lf_setBasicInfo("U");
- }
- }
- /****************************************************************************************
- * Function : fGetRecIfData_MMR01001
- * Description : Brief OP Note의 Data를 설정한다.
- ****************************************************************************************/
- function fGetRecIfData_MMR01001(infoflag) {
-
- if (utlf_isNull(parent.fGetFormRec("oprsrvno"))) {
- return;
- }
- ds_send_extninfo.clearData();
- var nRow = ds_send_extninfo.addRow();
- ds_send_extninfo.setColumn(nRow, "infoflag", infoflag);
-
- ds_send_extninfo.setColumn(nRow, "pid", parent.fGetFormRec("pid"));
- ds_send_extninfo.setColumn(nRow, "oprsrvno", parent.fGetFormRec("oprsrvno"));
-
- dsf_setDefaultVal(ds_send_extninfo, "dschdd:99991231");
-
- var oParam = {};
- oParam.id = "TRMMR01302";
- oParam.service = "medirecapp.RecIf";
- oParam.method = "reqGetFormRecExtnInfo";
- oParam.inds = "req=ds_send_extninfo";
- oParam.outds = "ds_main_extninfo_resultinfo=resultinfo ds_main_extninfo_staffauthinfo=staffauthinfo ds_main_extninfo_oprinfo=oprinfo "
- + "ds_main_extninfo_oplistinfo=oplistinfo ds_main_extninfo_recitem=recitem ds_main_extninfo_drlistinfo=drlistinfo "
- + "ds_data_diagcdlist=diagcdlist ds_main_extninfo_selectoplist=selectoplist ds_main_extninfo_dscinoutinfo=dscinoutinfo "
- + "ds_main_extninfo_rectextinfo=rectextinfo ds_main_extninfo_anstdrlistinfo=anstdrlistinfo ds_main_extninfo_oproomlistinfo=oproomlistinfo "
- + "ds_main_extninfo_recseqinfo=recseqinfo ds_main_extninfo_etcinfo=etcinfo";
- oParam.async = false;
- oParam.callback = "cf_TRMMR01302";
- tranf_submit(oParam);
-
- if(arErrorCode.pop("TRMMR01302") > -1)
- {
- var nRow = ds_main_extninfo_resultinfo.rowposition;
- var execInfoFlag = ds_main_extninfo_resultinfo.getColumn(nRow, "infoflag");
-
- if (execInfoFlag.indexOf("opr;") > -1) {
- //수술정보 설정
- //수술일자,진료일자
- var degnitemlevlcd = "";
- var nOprRow = ds_main_extninfo_oprinfo.rowposition;
- var opcnfmdd = ds_main_extninfo_oprinfo.getColumn(nOprRow, "opcnfmdd");
- var opcnfmhm = ds_main_extninfo_oprinfo.getColumn(nOprRow, "opcnfmhm");
- var nFindRow = ds_data_recitem.findRow("degnitemlevlcd", "0000515");
- ds_data_recitem.setColumn(nFindRow, "reccnts", opcnfmdd);
- grup_base.ipt_surg.value = opcnfmdd;
-
- //2010.01.11 dhkim - 진료일자,진료시간 세팅
- parent.fSetFormRec("formrecdd", opcnfmdd);
- parent.fSetFormRec("formrechm", opcnfmhm);
-
- //집도의 설정
- var drNames = fMakeDrNames_MMR01001(new Array("perfdrnm", "perfdrnm2", "perfdrnm3"));
- nFindRow = ds_data_recitem.findRow("degnitemlevlcd", "0000980");
- ds_data_recitem.setColumn(nFindRow, "reccnts", drNames);
- grup_base.ipt_odt1.value = drNames;
- //보조의 설정
- drNames = fMakeDrNames_MMR01001(new Array("assdrnm", "assdrnm2", "assdrnm3", "assdrnm4"));
- nFindRow = ds_data_recitem.findRow("degnitemlevlcd", "0000341");
- ds_data_recitem.setColumn(nFindRow, "reccnts", drNames);
- grup_base.ipt_sdt1.value = drNames;
-
-
- //2010.01.18 dhkim - 주마취, 부마취를 무조건 rectermcd, rectermnm과 연동하도록 변경
- //주마취 설정
-
- var anstmthdcd = ds_main_extninfo_oprinfo.getColumn(nOprRow, "anstmthdcd");
- var anstmthdnm = ds_main_extninfo_oprinfo.getColumn(nOprRow, "anstmthdnm");
- if(!utlf_isNull(anstmthdcd)){
- anstmthdcd = "-";
- }
- grup_base.ipt_mcdnm.value = anstmthdnm;
- degnitemlevlcd = grup_base.ipt_mcdnm.degnitemlevlcd;
- nFindRow = ds_data_recitem.findRow("degnitemlevlcd", degnitemlevlcd); //0000248.0015528
- ds_data_recitem.setColumn(nFindRow, "rectermcd", anstmthdcd);
- ds_data_recitem.setColumn(nFindRow, "rectermnm", anstmthdnm);
-
-
- //부마취 설정
- var anstmthdcdsub = ds_main_extninfo_oprinfo.getColumn(nOprRow, "anstmthdcdsub");
- var anstmthdcdsubnm = ds_main_extninfo_oprinfo.getColumn(nOprRow, "anstmthdcdsubnm");
- if(!utlf_isNull(anstmthdcdsub)){
- anstmthdcdsub = "-";
- }
- grup_base.ipt_scdnm.value = anstmthdcdsubnm;
- degnitemlevlcd = grup_base.ipt_scdnm.degnitemlevlcd;
- nFindRow = ds_data_recitem.findRow("degnitemlevlcd", degnitemlevlcd); //0000248.0008458
- ds_data_recitem.setColumn(nFindRow, "rectermcd", anstmthdcdsub);
- ds_data_recitem.setColumn(nFindRow, "rectermnm", anstmthdcdsubnm);
-
- }
-
- if (execInfoFlag.indexOf("opdiag;") > -1 && lodedYn == true) {
- //수술진단 설정
- // copyNodeset("/root/main/diaginfo/diagcdlist", "/root/main/extninfo/diagcdlist", "replace", ivw_0007983001.model, model);
- // copyNodeset("/root/main/diaginfo/diagcdlist", "/root/main/extninfo/diagcdlist", "replace", ivw_0000521001.model, model);
- grup_base.ivw_0007983001.fSetDiagNmInstance();
- grup_base.ivw_0000521001.fSetDiagNmInstance();
- }
-
- if (execInfoFlag.indexOf("opnm;") > -1 && lodedYn == true) {
- //수술명설정
- if( !grup_base.ivw_0000509001.isValidObject("ds_tmpop_selectoplist") )
- grup_base.ivw_0000509001.dsf_createDs("ds_tmpop_selectoplist");
-
- grup_base.ivw_0000509001.ds_tmpop_selectoplist.copyData(ds_main_extninfo_selectoplist);
- grup_base.ivw_0000509001.fAfterSrch();
- }
-
- if( lodedYn == true )
- fViewOPfindingsCaption_SMMMR01001('0000512001');
- else
- this.setTimer(1003, 500);
- //fViewOPfindingsCaption_SMMMR01001('0022906001');
-
- var sStatus = fGetFormRec("status");
- lf_setBasicInfo(sStatus); //수술 정보 기록데이터 세팅
- }
-
- lodedYn = true; // 로드 시점 처리
- }
- function cf_TRMMR01302(sSvcId, nErrorCode, sErrorMsg) {
- arErrorCode.push(sSvcId, nErrorCode);
- if(nErrorCode < 0) return;
- dsf_setDefaultVal(ds_main_extninfo_recitem, "recitemno:'',degnitemno:'',supdegnitemno:''");
- dsf_setTypeFormat(ds_main_extninfo_recitem, "recitemno:INT^degnitemno:INT^supdegnitemno:INT");
- }
- /****************************************************************************************
- * Function : fMakeDrNames_MMR01001
- * Description : Arr 에 대한 값을 리턴
- ****************************************************************************************/
- function fMakeDrNames_MMR01001(arr) {
- var buf = "";
- for (var i=0; i<arr.length; i++) {
- var nm = ds_main_extninfo_oprinfo.getColumn(0, arr[i]);
- if (utlf_isNull(nm)) {
- break;
- } else {
- buf += nm;
- if (i<arr.length-1 && !utlf_isNull(ds_main_extninfo_oprinfo.getColumn(0, arr[i+1]))) {
- buf += ", ";
- }
- }
- }
-
- return buf;
- }
- /* jw.choe 주석처리
- function fInitAnstTypeCtrl_MMR01001() {
- //2010.01.18 dhkim - 마취바인딩 무조건 rectermcd, rectermnm으로 변경
- var anstmthdcd = "";
- var mcdnm = "";
- var anstmthdcdsub = "";
- var scdnm = "";
-
- //주마취
- var node = model.instance1.selectSingleNode(gPageInfo.recItemRef2+"[degnitemlevlcd='0000248.0015528']");
- if (node != null) {
- anstmthdcd = node.getXPathString("rectermcd");
- mcdnm = node.getXPathString("rectermnm");
- }
- //부마취
- node = model.instance1.selectSingleNode(gPageInfo.recItemRef2+"[degnitemlevlcd='0000248.0008458']");
- if (node != null) {
- anstmthdcdsub = node.getXPathString("rectermcd");
- scdnm = node.getXPathString("rectermnm");
- }
- var pageInfo = new PAGEINFO();
- var iptMObj = document.controls("ipt_mcdnm");
- var iptSObj = document.controls("ipt_scdnm");
-
- if(anstmthdcd == null || anstmthdcd == ""){
- anstmthdcd = "-";
- }
-
- if(anstmthdcdsub == null || anstmthdcdsub == ""){
- anstmthdcdsub = "-";
- }
-
- //주마취
- model.setValue("/root/main/recinfo/recitem[degnitemlevlcd='" + iMcdnm + "']/rectermcd", anstmthdcd);
- model.setValue("/root/main/recinfo/recitem[degnitemlevlcd='" + iMcdnm + "']/rectermnm", mcdnm);
-
- iptMObj.attribute("ref") = pageInfo.recItemRef + "[degnitemlevlcd='" + iMcdnm + "']/rectermnm";
- //부마취
- model.setValue("/root/main/recinfo/recitem[degnitemlevlcd='" + iScdnm + "']/rectermcd", anstmthdcdsub);
- model.setValue("/root/main/recinfo/recitem[degnitemlevlcd='" + iScdnm + "']/rectermnm", scdnm);
-
- iptSObj.attribute("ref") = pageInfo.recItemRef + "[degnitemlevlcd='" + iScdnm + "']/rectermnm";
-
- iptMObj.refresh();
- iptSObj.refresh();
- }
- */
- /****************************************************************************************
- * Function : fChkPreSave
- * Description : 저장전 체크 로직
- ****************************************************************************************/
- function fChkPreSave()
- {
- var nFindRow = "";
-
- // [요청번호:20161230015] 수술관련 기록인증 제어여부(일반의사)
- if( lf_getHardCDList("Y", 9976, 3 , null) == "Y" ){
-
- var arrOdSd = ["ipt_odt1", "ipt_sdt1"];
- var objItem = null;
- for(var i=0; i<arrOdSd.length; i++){
- objItem = grup_base.components[arrOdSd[i]];
- if(!utlf_isNull(objItem)){
- var degnitemlevlcd = objItem.degnitemlevlcd;
- nFindRow = ds_data_recitem.findRow("degnitemlevlcd", degnitemlevlcd);
- var drNames = ds_data_recitem.getColumn(nFindRow, "reccnts");
- if( !utlf_isNull(drNames) && drNames.indexOf("일반의사") > -1){
- sysf_messageBox("집도의/보조의는 [일반의사]가 불가능합니다.", "E");
- return false;
- }
- }
- }
- }
-
- //2010.01.18 dhkim 마취종류 주, 부 필수체크
- //(degnitemkind='STX'이나 데이터는 rectermcd, rectermnm에 들어가므로 EMRCommon.js에서 필수체크할수 없음)
- //주마취
- nFindRow = ds_data_recitem.findRow("degnitemlevlcd", grup_base.ipt_mcdnm.degnitemlevlcd); //iMcdnm
- var anstmthdcd = ds_data_recitem.getColumn(nFindRow, "rectermcd");
- var anstmthdnm = ds_data_recitem.getColumn(nFindRow, "rectermnm");
- //default값세팅
- if(utlf_isNull(anstmthdcd)){
- anstmthdcd = "-";
- ds_data_recitem.setColumn(nFindRow, "rectermcd", anstmthdcd);
- }
- if(utlf_isNull(anstmthdnm)){
- sysf_messageBox("마취종류(주)는 필수 입력입니다.", "E");
- return false;
- }
-
- //부마취
- nFindRow = ds_data_recitem.findRow("degnitemlevlcd", grup_base.ipt_scdnm.degnitemlevlcd); //iScdnm
- var anstmthdcdsub = ds_data_recitem.getColumn(nFindRow, "rectermcd");
- var anstmthdcdsubnm = ds_data_recitem.getColumn(nFindRow, "rectermnm");
- //default값세팅
- if(utlf_isNull(anstmthdcdsub)){
- anstmthdcdsub = "-";
- ds_data_recitem.setColumn(nFindRow, "rectermcd", anstmthdcdsub);
- }
-
- if(utlf_isNull(anstmthdcdsubnm)){
- sysf_messageBox("마취종류(부)는 필수 입력입니다.", "E");
- return false;
- }
-
- //특이사항 여부 관련 체크
- if (grup_base.radio3.value == "0001347001" && !utlf_isNull(grup_base.textarea10.value)) {
- sysf_messageBox("특이사항 여부가 [N] 으로 체크되었지만 특이사항이 입력되었습니다","E");
- return false;
- }
-
- if (grup_base.radio3.value == "0001965001" && utlf_isNull(grup_base.textarea10.value)) {
- sysf_messageBox("특이사항 여부가 [Y] 으로 체크되었지만 특이사항이 없습니다","E");
- return false;
- }
- var pageInfo = new PAGEINFO();
- //수술전진단명
- nFindRow = ds_data_formdegn.findRow("degnitemcd", "0007983001");
- var itemNm = ds_data_formdegn.getColumn(nFindRow, "itemnm");
- var rtnVal = grup_base.ivw_0007983001.fChkGrdPreSave(true, itemNm);
- if(rtnVal == false){
- return rtnVal;
- }else{
- //수술후진단명
- nFindRow = ds_data_formdegn.findRow("degnitemcd", "0000521001");
- itemNm = ds_data_formdegn.getColumn(nFindRow, "itemnm");
- return grup_base.ivw_0000521001.fChkGrdPreSave(true, itemNm);
- }
-
-
- }
- /****************************************************************************************
- * Function : getSubmitID_MMR01300I
- * Description : MMR01300.js에서 submit직전에 submitID를 설정하기 위해서 호출한다.
- ****************************************************************************************/
- function getSubmitID_MMR01300I() {
- parent.fSetFormRec("xsltflag", "JCI");//통합기록조회용 JCI구분자추가
- return TX_SUBMIT_EXTN_FORM;
- }
- ]]></Script>
|