123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330 |
- <?xml version="1.0" encoding="EUC-KR"?>
- <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.css" ?>
- <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
- <xhtml:head>
- <xhtml:title>처방사유 입력</xhtml:title>
- <model id="model1">
- <instance id="instance1">
- <root xmlns="">
- <result>
- <saveflaginfo>
- <msgdd/>
- <msgno/>
- <histno/>
- <msgcls/>
- </saveflaginfo>
- <prcpmsglist>
- <instcd/>
- <msgdd/>
- <msgno/>
- <histno/>
- <msgseq/>
- <msgcls/>
- <prcpcd/>
- <prcpnm/>
- <errcd/>
- <errmsg/>
- <errdisc/>
- <cnfcd/>
- <cnfmsg/>
- </prcpmsglist>
- </result>
- <hardcd>
- <hardcd>
- <status/>
- <hardcd/>
- <hardcdnm/>
- </hardcd>
- </hardcd>
- <send>
- <cond1/>
- </send>
- <init>
- <cond1>Y</cond1>
- </init>
- </root>
- </instance>
- <submission id="TRZBC00101" mediatype="application/x-www-form-urlencoded" method="post"/>
- <submission id="TRMMB16401" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/hardcd"/>
- <submission id="TRMMO90101" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/result/saveflaginfo" resultref="/root/result/prcpmsglist"/>
- <submission id="TXMMO90101" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/result/prcpmsglist" resultref="/root/result"/>
- <bind id="bind1" ref="/root/hardcd/hardcd/hardcdnm" readonly="../hardcd != 'T'"/>
- <script type="javascript" ev:event="xforms-ready">
- <![CDATA[
- var msgno = model.getValue("/root/result/saveflaginfo/msgno");
- if(msgno == "0"){
- messageBox("메세지 정보가 정확하지 않습니다.", "E999");
- return;
- }
-
- model.makeValue("/root/result/saveflaginfo/msgcls", "R"); // 사유 조회(R) 로 설정
-
- submit("TRMMO90101");
-
- var sErrMsg = "";
- grd_prcpmsglist.rebuildStyle();
- for (var i=1; i<grd_prcpmsglist.rows; i++) {
- sErrMsg = model.getValue("/root/result/prcpmsglist["+i+"]/errmsg");
-
- if (isSearchString(sErrMsg, "주의! 마약") || isSearchString(sErrMsg, "향정신성의약품")){
- grd_prcpmsglist.cellstyle("background-color", i, grd_prcpmsglist.colRef("errmsg") ) = "#f3e1bf" ;
- }
- }
- ]]>
- </script>
- </model>
- <script type="javascript" src="../../../com/commonweb/js/common.js"/>
- <script type="javascript" src="../../../emr/prcpmngtweb/js/MMO001.js"/>
- <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
- <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
- <script type="javascript">
- <![CDATA[
- // 화면 전역변수
- var cRow = ""; // 사유입력리스트에서 선택된 행
- var cResnFlag = ""; // 사유입력리스트에서 선택된 사유구분
-
- // 화면 open, 저장시 초기화 기능을 수행한다.
- function fClose() {
- window.close();
- }
-
-
- function fSelectResn() {
- var resnRow = grd_resnlist.row;
- var prcpRow = grd_prcpmsglist.row;
- var sAllApply = model.getValue("/root/init/cond1"); // 일괄적용여부
-
- if (resnRow != -1 && prcpRow != -1) {
- var sStatus = model.getValue("/root/hardcd/hardcd[" + resnRow + "]/status"); // 선택된 사유 상태
- var sCnfCd = model.getValue("/root/hardcd/hardcd[" + resnRow + "]/hardcd"); // 선택된 사유 코드
- var sCnfMsg = model.getValue("/root/hardcd/hardcd[" + resnRow + "]/hardcdnm"); // 선택된 사유 상세
-
- if(sCnfMsg == "(이곳에 사유입력을 하세요)" || sCnfMsg == "기타사유 (직접입력)") {
- grd_resnlist.col = grd_resnlist.colRef("hardcdnm");
- grd_resnlist.colDisabled(grd_resnlist.col) = false;
- grd_resnlist.editCell();
- } else {
- var sMultiYn = model.getValue("/root/result/prcpmsglist[" +prcpRow+ "]/multiyn"); // 멀티선택 가능여부
- if(sMultiYn == "N") { // 단일 선택이면
- if(sStatus == "N") { // 현재 선택되지 않은 값이면 신규 선택
- var resnLength = model.instances(0).selectNodes( "/root/hardcd/hardcd" ).length;
- for ( var i= 1; i<=resnLength; i++ ) { // 사유항목별 for
- if( resnRow == i) {
- model.setValue("/root/hardcd/hardcd[" + i + "]/status", "Y"); // 선택 체크
- } else {
- model.setValue("/root/hardcd/hardcd[" + i + "]/status", "N"); // 선택 해제
- }
- } // end of 사유항목별 for
- } else { // 현재 선택된 값이면 선택취소
- model.setValue("/root/hardcd/hardcd[" + resnRow + "]/status", "N"); // 선택 해제
-
- sCnfCd = "-"; // 선택코드 초기화
- sCnfMsg = "-"; // 선택사유 초기화
- }
- } else { // 멀티 선택이면
- if(sStatus == "N") { // 현재 선택되지 않은 값이면 신규 선택
- model.setValue("/root/hardcd/hardcd[" + resnRow + "]/status", "Y"); // 선택 해제
- } else { // 현재 선택된 값이면 선택취소
- model.setValue("/root/hardcd/hardcd[" + resnRow + "]/status", "N"); // 선택 해제
- }
-
- sCnfCd = "-"; // 선택코드 초기화
- sCnfMsg = "-"; // 선택사유 초기화
- var resnLength = model.instances(0).selectNodes( "/root/hardcd/hardcd" ).length;
- for ( var i= 1; i<=resnLength; i++ ) { // 사유항목별 for
- if( model.getValue("/root/hardcd/hardcd[" + i + "]/status") == "Y") { // 선택되었으면
- if(sCnfCd == "-") { // 첫번째 선택의 경우
- sCnfCd = model.getValue("/root/hardcd/hardcd[" + i + "]/hardcd"); // 선택된 사유 코드
- sCnfMsg = model.getValue("/root/hardcd/hardcd[" + i + "]/hardcdnm"); // 선택된 사유 상세
- } else { // 첫번째 선택이 아닌경우
- sCnfCd = sCnfCd + "|" + model.getValue("/root/hardcd/hardcd[" + i + "]/hardcd"); // 선택된 사유 코드
- sCnfMsg = sCnfMsg + "|" + model.getValue("/root/hardcd/hardcd[" + i + "]/hardcdnm"); // 선택된 사유 상세
- }
- }
- } // end of 사유항목별 for
- }
-
- if(sAllApply == "Y") { // 일괄 적용이면
- var checkLength = model.instances(0).selectNodes( "/root/result/prcpmsglist" ).length;
- var sSelErrCd = model.getValue("/root/result/prcpmsglist[" +prcpRow+ "]/errcd"); // 오류 코드
- var sChkErrCd = "";
-
- for ( var i= 1; i<=checkLength; i++ ) {
- sChkErrCd = model.getValue ( "/root/result/prcpmsglist[" + i + "]/errcd" );
- if(sSelErrCd == sChkErrCd) {
- model.setValue("/root/result/prcpmsglist[" + i + "]/cnfcd", sCnfCd);
- model.setValue("/root/result/prcpmsglist[" + i + "]/cnfmsg", sCnfMsg);
- }
- }
- } else {
- model.setValue("/root/result/prcpmsglist[" + prcpRow + "]/cnfcd", sCnfCd);
- model.setValue("/root/result/prcpmsglist[" + prcpRow + "]/cnfmsg", sCnfMsg);
- }
-
- model.refresh();
- }
- }
- }
- ]]>
- </script>
- </xhtml:head>
- <xhtml:body pagewidth="865" pageheight="550" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
- <caption id="caption1" class="tit_2" style="left:5px; top:2px; width:302px; height:13px; ">처방 사유 입력</caption>
- <switch id="switch1" style="left:2px; top:17px; width:843px; height:498px; ">
- <case id="case1" selected="true" style="left:0px; top:0px; width:843px; height:495px; ">
- <datagrid id="grd_prcpmsglist" nodeset="/root/result/prcpmsglist" autoresize="true" caption="사유구분^처방코드^처방명^사유코드^내용^코드^상세사유" colsep="^" colwidth="130, 70, 140, 55, 335, 30, 60" dataheight="23" ellipsis="true" extendlastcol="scroll" rowheight="23" rowsep="|" selectionmode="free" tooltip="true" style="left:0px; top:5px; width:843px; height:255px; ">
- <col ref="errdisc"/>
- <col ref="prcpcd"/>
- <col ref="prcpnm"/>
- <col ref="errcd" style="text-align:center; "/>
- <col ref="errmsg"/>
- <col ref="cnfcd" style="text-align:center; "/>
- <col ref="cnfmsg"/>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- if (isDataCell()) {
- var sResnListCd = model.getValue("/root/result/prcpmsglist[" +grd_prcpmsglist.row+ "]/resnlistcd"); // 사유입력시 사유리스트 하드코드
- var sMultiYn = model.getValue("/root/result/prcpmsglist[" +grd_prcpmsglist.row+ "]/multiyn"); // 멀티선택 가능여부
-
- if(sResnListCd == "0") {
- alert("관련된 사유 정보가 존재 하지 않습니다.\n전산실(6598)로 문의 하세요.");
- return;
- }
-
- if(sMultiYn == "N") { // 단일선택이면
- caption10.visible = false;
- } else {
- caption10.visible = true;
- }
-
- model.setValue ( "/root/send/cond1", sResnListCd );
- submit("TRMMB16401" );
- model.refresh();
- }
- ]]>
- </script>
- </datagrid>
- <caption id="caption6" class="tit_2" style="left:5px; top:266px; width:75px; height:14px; ">사유선택</caption>
- <line id="line4" class="line_1" style="x1:0px; y1:284px; x2:843px; y2:284px; "/>
- <datagrid id="grd_resnlist" nodeset="/root/hardcd/hardcd" autoresize="true" caption="선택^코드^상세사유" colsep="^" colwidth="35, 50, 737" dataheight="23" ellipsis="true" extendlastcol="scroll" rowheight="23" rowsep="|" tooltip="true" style="left:0px; top:290px; width:843px; height:205px; ">
- <col checkvalue="Y,N" ref="status" type="checkbox" style="focus-rect:visible; "/>
- <col ref="hardcd" style="text-align:center; "/>
- <col disabled="false" editable="true" imemode="hangul" ref="hardcdnm" type="input"/>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- if (isDataCell() ) {
- var currow = grd_resnlist.row;
- if ( grd_resnlist.col == grd_resnlist.colref("hardcdnm")) {
- if ( model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcdnm" ) == "(이곳에 사유입력을 하세요)"
- || model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcdnm" ) == "기타사유 (직접입력)" ) {
- grd_resnlist.col = grd_resnlist.colRef("hardcdnm");
- grd_resnlist.colDisabled(grd_resnlist.col) = false;
- grd_resnlist.editCell();
- } else {
- grd_resnlist.colDisabled(grd_resnlist.col) = true;
- }
- } else if ( grd_resnlist.col == grd_resnlist.colref("status")) {
- // fSelectResn() 함수에서 동일하게 처리하기위해 값을 변경한다. 2015.03.26 엄영만
- if(model.getValue ( "/root/hardcd/hardcd[" + currow + "]/status") == "Y") {
- model.setValue ( "/root/hardcd/hardcd[" + currow + "]/status" , "N");
- } else {
- model.setValue ( "/root/hardcd/hardcd[" + currow + "]/status" , "Y");
- }
-
- fSelectResn();
- }
- }
- ]]>
- </script>
- <script type="javascript" ev:event="onendedit">
- <![CDATA[
- var currow = grd_resnlist.row;
- if ( model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcdnm" ) != "(이곳에 사유입력을 하세요)"
- && model.getValue ( "/root/hardcd/hardcd[" + currow + "]/hardcdnm" ) != "기타사유 (직접입력)" ) {
- fSelectResn();
- }
- ]]>
- </script>
- <script type="javascript" ev:event="ondblclick">
- <![CDATA[
- if (isDataCell() ) {
- fSelectResn();
- }
- ]]>
- </script>
- </datagrid>
- <line id="line1" class="line_1" style="x1:0px; y1:2px; x2:843; y2:2px; "/>
- <button id="button1" class="btn2_letter4" style="left:776px; top:263px; width:64px; height:19px; ">
- <caption>사유적용</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- if(grd_resnlist.row != -1) {
- fSelectResn();
- }else{
- messageBox ( "선택된 사유가 없습니다." , "I" );
- }
- ]]>
- </script>
- </button>
- <bool id="bool_cond1" checkvalue="Y,N" overflow="visible" appearance="full" ref="/root/init/cond1" style="left:700px; top:265px; width:20px; height:20px; border-style:none; "/>
- <caption id="caption3" style="left:720px; top:265px; width:50px; height:20px; ">일괄적용</caption>
- </case>
- </switch>
- <button id="button3" class="btn4_letter4" style="left:642px; top:520px; width:80px; height:22px; ">
- <caption>계속저장</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- var checkLength = model.instances(0).selectNodes( "/root/result/prcpmsglist" ).length;
- var resnCnt = 0;
- var sUserId = "";
-
- if ( checkLength > 0 ) {
- sUserId = getUserInfo("userid");
-
- for ( var i =1; i <= checkLength; i++ ) {
- model.makeValue ( "/root/result/prcpmsglist[" + i + "]/userid", sUserId);
-
- if ( isNull(model.getValue ( "/root/result/prcpmsglist[" + i + "]/cnfcd" ))
- || isNull(model.getValue ( "/root/result/prcpmsglist[" + i + "]/cnfmsg" ))
- || "-" == model.getValue ( "/root/result/prcpmsglist[" + i + "]/cnfcd" )
- || "-" == model.getValue ( "/root/result/prcpmsglist[" + i + "]/cnfmsg" ) ) {
- resnCnt++;
- }
- }
- if (resnCnt > 0) {
- messageBox ( "처방사유 선택되지 않은 처방이", "I010" );
- return;
- }
-
- model.makeValue("/root/result/saveflaginfo/cnfcd", "Y"); // 확인 코드를 'Y' 로 설정
-
- if(submit("TXMMO90101")){
- opener.javascript.setParameter ( "SPMMO90200_rtn", "Y" );
- }
- }
-
- window.close();
- ]]>
- </script>
- </button>
- <button id="btn_cncl" class="btn4_letter7" style="left:731px; top:520px; width:116px; height:22px; ">
- <caption>처방변경(닫기)</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- opener.javascript.setParameter ( "SPMMO90200_rtn", "N" );
- window.close();
- ]]>
- </script>
- </button>
- <caption id="caption4" style="left:110px; top:3px; width:715px; height:16px; ">아래의 처방은 사유를 선택 또는 입력 하셔야 발행이 가능 합니다. 처방을 선택하면 사유구분에 맞는 사유 항목이 조회 됩니다.</caption>
- <caption id="caption7" style="left:80px; top:285px; width:205px; height:16px; ">아래의 항목에서 사유를 선택 하세요.</caption>
- <caption id="caption10" visibility="hidden" style="left:282px; top:285px; width:90px; height:16px; color:#0000ff; ">(멀티선택가능)</caption>
- <caption id="caption9" style="left:380px; top:285px; width:320px; height:16px; ">일괄적용 체크 되면 동일한 사유구분은한번에 적용 됩니다.</caption>
- <group id="group2" scroll="auto" style="left:0px; top:520px; width:240px; height:27px; ">
- <shape id="roundrect4" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:5px; top:0px; width:230px; height:27px; background-color:transparent; border-color:#7cbbdd; border-style:solid; "/>
- <caption id="caption20" class="cell_2" style="left:10px; top:5px; width:50px; height:20px; ">범 례</caption>
- <caption id="caption5" class="color_7" style="left:65px; top:9px; width:15px; height:15px; vertical-align:middle; "/>
- <caption id="caption8" style="left:85px; top:10px; width:150px; height:13px; ">마약 또는 향정신성 의약품</caption>
- </group>
- </xhtml:body>
- </xhtml:html>
|