123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278 |
- /* ---------------------------------------------------------------------
-
- 처방(물품)찾기(SMMNP01601.xfm - JScript )
- - Version :
- 1) : Ver.1.00.01
- : Create By Francis Choi
- : 2015.05.02
- ---------------------------------------------------------------------- */
-
- var CondPath = "/root/main/cond";
- var SendPtah = "/root/send/reqdata";
- /* ------------------------------------------------- */
- /* SMMNP01601_처방(물품)찾기 */
- /* On Load 시 Call */
- /* ------------------------------------------------- */
- /* group : EMR 간호 수술마취 */
- /* ver : 2015.05.15 */
- /* by : 최학록 */
- /* --------------------------------------------------*/
- /* type : function */
- /* access : public */
- /* desc : xforms-ready시 수행한다 */
- /* return : */
- /* --------------------------------------------------*/
-
- function fFormInit() {
- model.removeNodeset("/root/main/goodlist");
- model.removeNodeset("/root/main/prcplist");
-
- submit("TRMNP04462");
-
- if (checkOpener() ) {
- var refnm = opener.javascript.getParameter("refnm");
- var refflag = opener.javascript.getParameter("refflag");
- var goodflag = opener.javascript.getParameter("goodflag");
-
- model.setValue(CondPath + "/refnm" , refnm );
- model.setValue(CondPath + "/refflag" , refflag );
- model.setValue(CondPath + "/goodflag", goodflag);
-
- model.refresh();
-
- if (( refnm == "" )||
- ( refflag == "" )||
- ( goodflag == "" ) ) {//물품구분, 조회조건, 조회구분이 없으면 리턴
- if (refflag == "" ) {
- model.setValue(CondPath + "/refflag", '1');
- model.refresh();
- }
-
- return;
- }else {
-
- var currentText = ipt_refcond.currentText;
- currentText = currentText.toUpperCase();
- model.setValue(CondPath + "/refnm", currentText);
-
- ipt_refcond.refresh();//대문자로 변경
-
- model.copyNode("/root/send/reqdata", CondPath);
- submit("TRMNP04461");
- }
- }
- }
- // --------------------------------------
- // P:처방분류선택, G:물품구분선택
- // --------------------------------------
- function fComboListChange(pDataCls) {
-
- model.removeNodeset("/root/init/lrglist");
- model.removeNodeset("/root/init/mdllist");
- model.removeNodeset("/root/init/smllist");
-
- model.setValue(CondPath + "/lrgcd", "");
- model.setValue(CondPath + "/mdlcd", "");
- model.setValue(CondPath + "/smlcd", "");
-
- model.copyNode("/root/send/reqdata", "/root/main/cond");
-
- if (pDataCls == "P") {
- submit("TRMNP04467"); // 처방분류선택
- return;
- }
-
- submit("TRMNP04463");
-
- var currentText = ipt_refcond.currentText;
- currentText = currentText.toUpperCase();
-
- model.setValue(CondPath + "/refnm", currentText);
-
- ipt_refcond.refresh();//대문자로 변경
-
- var refnm = model.getValue(CondPath + "/refnm");
-
- if (refnm != "" ) { //메인화면에서 검색어를 치고 들어온 경우 물품구분 선택시 자동 조회
- if( (model.getValue(CondPath + "/goodflag") == "" )||
- (model.getValue(CondPath + "/lrgcd" ) == "" )||
- (model.getValue(CondPath + "/mdlcd" ) == "" ) ) {
- if (model.getValue(CondPath + "/refflag") == "" ) {
- messageBox("조회구분을 선택 하지", "E007");
- return;
- }
- }
-
- model.copyNode("/root/send/reqdata", "/root/main/cond");
- submit("TRMNP04461");
- model.resetInstanceNode("/root/send/reqdata");
- }
- }
- // --------------------------------------
- // P:처방분류선택, G:물품구분선택
- // --------------------------------------
- function fDataQuery() {
- var currentText = ipt_refcond.currentText;
- currentText = currentText.toUpperCase();
- model.setValue(CondPath + "/refnm", currentText);
- ipt_refcond.refresh(); //대문자로 변경
- if( (model.getValue(CondPath + "/goodflag") == "" )||
- (model.getValue(CondPath + "/lrgcd" ) == "" )||
- (model.getValue(CondPath + "/mdlcd" ) == "" ) ) {
- if (model.getValue(CondPath + "/refflag") == "" ) {
- messageBox("조회구분을 선택 하지", "E007");
- return;
- }
- }
-
- model.copyNode("/root/send/reqdata", CondPath);
- var xNode = instance1.selectSingleNode(SendPtah);
-
- if (xNode == null) {
- model.makeNode(SendPtah);
- }
-
- model.copyNode(SendPtah, CondPath);
- if ( rdo_reftrgt.value == "PRC" ) {
- model.removeNodeset("/root/main/prcplist");
- submit("TRMNP04467");
- }else {
- model.removeNodeset("/root/main/goodlist");
- submit("TRMNP04461");
- }
- model.resetInstanceNode("/root/send/reqdata");
-
- }
- // --------------------------------------
- // Grid Data Click
- // --------------------------------------
- function fGridDataClick(pGrid, pName) {
- var iRow = pGrid.row;
-
- var pPath = "/root/main/"+ pName +"[" + pGrid.row + "]/chkflag";
-
- if (pGrid.rows < 1 || pGrid.row == 0){
- return;
- }
- else if (pGrid.col == 1) {
- return;
- }else {
- var sFlag = model.getValue(pPath);
- model.setValue(pPath, ((sFlag == "true") ? "false" :"true"));
- }
-
- model.refresh();
- }
-
- // --------------------------------------
- // Query Condition Select 조회 조건 선택
- // --------------------------------------
- function fQueryCondSelect(pGrid, pName) {
-
- var sLogical = "true";
-
- var sVisible1 = "visible";
- var sVisible2 = "hidden" ;
- model.setValue(CondPath + "/goodflag", "");
- model.setValue(CondPath + "/lrgcd" , "");
- model.setValue(CondPath + "/mdlcd" , "");
- model.setValue(CondPath + "/smlcd" , "");
- model.copyNode("/root/send/reqdata", CondPath);
- if (rdo_reftrgt.value == "PRC" ) {
- submit("TRMNP04463"); //처방분류 조회
- }else {
- submit("TRMNP04462");
- sLogical = "false" ;
- sVisible1 = "hidden" ;
- sVisible2 = "visible" ;
- }
- // ipt_refcond.disabled = sLogical;
- ipt_cmpycond.disabled = sLogical;
- ipt_custcond.disabled = sLogical;
- cmb_goodflag.disabled = sLogical;
-
- grd_prcplist.attribute("visibility") = sVisible1;
- grd_goodlist.attribute("visibility") = sVisible2;
-
- model.refresh();
- }
- // --------------------------------------
- // Query Condition Select 조회 조건 선택
- // --------------------------------------
- function fChoiceData() {
- var iParamList = "";
- var wCnt = 0 ;
- var wIDx = 0 ;
-
- var wCode = "goodcd";
- var wName = "goodnm";
- var iNode = "/root/main/goodlist";
-
- if (model.getValue(CondPath + "/tabflag") == "PRC" ) {
- wIDx = 1 ;
- wCode = "prcpcd";
- wName = "prcpnm";
- iNode = "/root/main/prcplist";
- }
-
- var wChk = "";
- var iRows = getNodesetCount(iNode);
- for( var i= 1; i <= iRows; i++ ) {
- wChk = model.getValue(iNode + "[" + i + "]/chkflag");
-
- if (wChk == "true") {
- iParamList += model.getValue(iNode + "[" + i + "]/" + wCode ) + "|" // 00 처방코드
- + model.getValue(iNode + "[" + i + "]/" + wName ) + "|" // 01 처방명
- + model.getValue(iNode + "[" + i + "]/allsizespecid") + "|" // 02 사이즈
- + model.getValue(iNode + "[" + i + "]/prodcmpynm" ) + "|" // 03 제조회사명
- + model.getValue(iNode + "[" + i + "]/cureflag" ) + "|" // 04 처치구분
- + model.getValue(iNode + "[" + i + "]/goodspec" ) + "|" // 05 물품규격
- + model.getValue(iNode + "[" + i + "]/goodmodel" ) + "|" // 06 물품모델
- + "" + "▩"; // 07 처방단위 model.getValue(iNode + "[" + i + "]/prcpunit" ))
-
- wCnt += 1;
- }
- }
- //
- // if (cnt < 1 ) {
- // messageBox("선택한 것이", "I004");
- // }else {
- if (checkOpener() ) {
- opener.javascript.setParameter("SendData", iParamList);
- window.close();
- }
- else {
- model.removenode("/root/send");
- model.makeValue("/root/send/SendData" , iParamList); // 기관코드
- }
- // }
- }
-
- /* ------------------------------------------------- */
- /* ------End Of List ------------------------------- */
- /* -------------------------------------------------- */
|