12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025 |
- /*
- - 상병관련 Function
- --------------------------------
- - fDiagSeqUp : 상병순서 위로
- - fDiagSeqDown : 상병순서 아래로
- - fSortDiagNo : 상병SORT
- - fDiagGridInsertRow : 행삽입
- - fDiagGridInsertRowMulti : 행추가(5줄)
- - fDiagGridDeleteRow : 행삭제
- - fDiagGridDeleteCancel : 삭제취소
- - fSearchDiageCode : 상병코드 PopUp 조회
- - fSearchSPPIZ00400 : 상병코드 PopUp 조회호출
- - fSetDiagCdNm : 상병코드 PopUp 반영
- */
- var gToday = new Date();
- var gBaseyear = gToday.getDateFormat("YYYY"); // (dateHelper.js)에서 제공하는 함수를 사용하여 해당 년를 구한다.
- var gBasemonth = gToday.getDateFormat("MM");
- var gBaseday = gToday.getDateFormat("DD");
- var gCurrentdd = gBaseyear + gBasemonth + gBaseday;
- var gCurrentym = gBaseyear + gBasemonth;
- var gClopSize = "AUTO"; // 현재상태 DEFAULT, FULL, AUTO, CHANGE
- // 20100614 환경초기화를 위한 로딩상태 저장
- var gCldihist_refdata = "";
- var gCldihist_sizedata = "";
- var gClodhist_refdata = "";
- var gClodhist_sizedata = "";
- var gClophist_refdata = "";
- var gClophist_sizedata = "";
- ///////////////////////////////////////////////////////////////////////////
- // 상병 Grid 마우스 오른쪽 버튼 클릭시 팝업 메뉴 "상병순서 위로"
- function fDiagSeqUp() {
- var rowstatus = grd_cldihist.rowstatus(grd_cldihist.row);
- if (rowstatus == 4) { // 4 : delete
- return;
- }
- var diagseq = parseInt(model.getValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/diagseq")); // 선택된 줄의 NO
- if (diagseq > 1) { // 첫번째 줄이 아닌 경우
- model.setValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/diagseq", --diagseq);
- if (rowstatus == 0 || rowstatus == 2) {
- grd_cldihist.rowstatus(grd_cldihist.row) = 2; // 2 : update
- }
- // 바로 위 상병순서와 중복되는 경우
- var nextrow = grd_cldihist.row - 1;
- var nextdiagseq = model.getValue(grd_cldihist.nodeset + "["+ nextrow +"]/diagseq");
- if (diagseq == nextdiagseq) {
- model.setValue(grd_cldihist.nodeset + "["+ nextrow +"]/diagseq", ++diagseq);
- rowstatus = grd_cldihist.rowstatus(nextrow);
- if (rowstatus == 0 || rowstatus == 2) {
- grd_cldihist.rowstatus(nextrow) = 2; // 2 : update
- }
- }
-
- // 20100329 MT002 입력체크
- if ( model.getValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/diagseq") == "1"
- && model.getValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/vcode") != ""
- ) {
- fSetDiagMT002(model.getValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/vcode"));
- }
-
- fSortDiagNo(false);
- }
- }
- // 상병 Grid 마우스 오른쪽 버튼 클릭시 팝업 메뉴 "상병순서 아래로"
- function fDiagSeqDown() {
- var rowstatus = grd_cldihist.rowstatus(grd_cldihist.row);
- if (rowstatus == 4) { // 4 : delete
- return;
- }
- // 삭제 상태가 아닌 마지막 줄을 찾는다.
- var lastRow = grd_cldihist.rows - 1;
- for (var i = 1; i < grd_cldihist.rows; i++) {
- if (grd_cldihist.rowstatus(i) == 4) { // delete
- lastRow = i - 1;
- i = grd_cldihist.rows;
- }
- }
- var diagseq = parseInt(model.getValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/diagseq")); // 선택된 줄의 NO
- if (diagseq < lastRow) { // 마지막 줄이 아닌 경우
- model.setValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/diagseq", ++diagseq);
- if (rowstatus == 0 || rowstatus == 2) {
- grd_cldihist.rowstatus(grd_cldihist.row) = 2; // 2 : update
- }
- // 바로 아래 상병순서와 중복되는 경우
- var nextrow = grd_cldihist.row + 1;
- var nextdiagseq = model.getValue(grd_cldihist.nodeset + "["+ nextrow +"]/diagseq");
- if (diagseq == nextdiagseq) {
- model.setValue(grd_cldihist.nodeset + "["+ nextrow +"]/diagseq", --diagseq);
-
- rowstatus = grd_cldihist.rowstatus(nextrow);
- if (rowstatus == 0 || rowstatus == 2) {
- grd_cldihist.rowstatus(nextrow) = 2; // 2 : update
- }
- }
-
- // 20100329 MT002 입력체크
- if ( model.getValue(grd_cldihist.nodeset + "["+ nextrow +"]/diagseq") == "1"
- && model.getValue(grd_cldihist.nodeset + "["+ nextrow +"]/vcode") != ""
- ) {
- fSetDiagMT002(model.getValue(grd_cldihist.nodeset + "["+ nextrow +"]/vcode"));
- }
-
- fSortDiagNo(false);
- }
- }
-
- // "상병순서 위로/아래로" 순서 변경 후에 상병 순서 NO에 따라 sorting 작업
- function fSortDiagNo(isNumbering) {
- var delcnt = 0;
-
- for (var i = 1; i < grd_cldihist.rows; i++) {
- grd_cldihist.rowHidden(i) = false;
- }
-
- if (isNumbering == false) {
- var maxRow = parseInt(grd_cldihist.rows) - 1; // rows는 타이틀부분 부터 개수를 센다
- grd_cldihist.sort(1, grd_cldihist.colRef("diagseq"), maxRow, grd_cldihist.colRef("diagseq")) = "asc"; // 타이틀을 제외한 data 부분의 첫 줄의 row = 1 / col = 3 : no
- // Sort 된 Grid 상의 Data 순서와 Instance Node 상의 Data 순서를 동일하게 맞춰준다.
- grd_cldihist.gridToInstance();
- }
-
- var cldino = 1;
- for (var i = 1; i < grd_cldihist.rows; i++) {
- // 2.----------------------------------------------------------------------
- if (grd_cldihist.rowstatus(i) != 4) { // delete
- var diagseq = model.getValue(grd_cldihist.nodeset + "["+ i +"]/diagseq");
- if (grd_cldihist.rowstatus(i) == 0 && diagseq != cldino) {
- grd_cldihist.rowstatus(i) = 2; // 2 : update
- }
- model.setValue(grd_cldihist.nodeset + "["+ i +"]/diagseq", cldino++);
- } else {
- delcnt++;
- }
- }
-
- var maxRow = parseInt(grd_cldihist.rows) - 1; // rows는 타이틀부분 부터 개수를 센다
- grd_cldihist.sort(1, grd_cldihist.colRef("diagseq"), maxRow, grd_cldihist.colRef("diagseq")) = "asc"; // 타이틀을 제외한 data 부분의 첫 줄의 row = 1 / col = 3 : no
- if (delcnt > 0) {
- grd_cldihist.sort(1, grd_cldihist.colRef("diagseq"), maxRow - delcnt, grd_cldihist.colRef("diagseq")) = "asc"; // 타이틀을 제외한 data 부분의 첫 줄의 row = 1 / col = 3 : no
- }
-
- // Sort 된 Grid 상의 Data 순서와 Instance Node 상의 Data 순서를 동일하게 맞춰준다.
- grd_cldihist.gridToInstance();
- /*
- model.setFocus("grd_cldihist");
- grd_cldihist.row = 1;
- */
-
- var rowstatus;
- for (var i = 1; i < grd_cldihist.rows; i++) {
- rowstatus = grd_cldihist.rowstatus(i);
- if (rowstatus > 3) { // 삭제상태
- grd_cldihist.rowHidden(i) = true;
- } else {
- grd_cldihist.rowHidden(i) = false;
- }
- }
- }
-
- // 사용자가 입력한 숫자를 기준으로 상병순서 부여
- function fChangeDiagNo() {
- var row = grd_cldihist.row;
- if (grd_cldihist.rowstatus(row) != 1 && grd_cldihist.rowstatus(row) != 3) { // 1 : insert, 3 : insert & new
- grd_cldihist.rowstatus(row) = 2; // 2 : update
- }
- var newseq = model.getValue(grd_cldihist.nodeset + "["+ row +"]/diagseq");
- var oldseq = model.getValue("/root/hidden/list1/cldi/oldseq");
- var vcode = model.getValue(grd_cldihist.nodeset + "["+ row +"]/vcode");
- if (newseq) {
- newseq = parseInt(model.getValue(grd_cldihist.nodeset + "["+ row +"]/diagseq"), 10); // '09' 와 같은 형식으로 입력한 경우 -> 9로 처리
- // 삭제상태가 아닌 중복된 번호가 있는지 체크한다.
- var sameRow = 0;
- for (var i = 1; i < grd_cldihist.rows; i++) {
- var diagseq = model.getValue(grd_cldihist.nodeset + "["+ i +"]/diagseq");
- if (row != i && diagseq == newseq) {
- sameRow = i;
- i = grd_cldihist.rows;
- }
- }
- if (sameRow > 0) { // 중복된 상병순서의 row가 있음
- if (newseq < oldseq) { // 이전보다 앞번호를 입력한 경우
- for (var j = sameRow; j < row; j++) {
- var rowstatus = grd_cldihist.rowstatus(j);
- if (rowstatus != 4) {
- var curseq = parseInt(model.getValue(grd_cldihist.nodeset + "["+ j +"]/diagseq"), 10);
- if (rowstatus != 1 && rowstatus != 3) {
- if (model.getValue(grd_cldihist.nodeset + "["+ j +"]/diagseq") != (curseq+1)) {
- grd_cldihist.rowstatus(j) = 2;
- }
- }
- model.setValue(grd_cldihist.nodeset + "["+ j +"]/diagseq", curseq+1);
- }
- }
- }
- else { // 이전보다 뒷번호를 입력한 경우
- for (var j = row+1; j <= sameRow; j++) {
- var rowstatus = grd_cldihist.rowstatus(j);
- if (rowstatus != 4) {
- var curseq = parseInt(model.getValue(grd_cldihist.nodeset + "["+ j +"]/diagseq"), 10);
- if (rowstatus != 1 && rowstatus != 3) {
- if (model.getValue(grd_cldihist.nodeset + "["+ j +"]/diagseq") != (curseq-1)) {
- grd_cldihist.rowstatus(j) = 2;
- }
- }
- model.setValue(grd_cldihist.nodeset + "["+ j +"]/diagseq", curseq-1);
- }
- }
- }
- fSortDiagNo(false);
- fDiagGridInsertRow("Y", "N"); // 상병마지막 그리드에 한 20090918 정승우
-
- // 20100329 MT002 입력체크
- if ( newseq == "1" && oldseq != "1" && vcode != "") {
- fSetDiagMT002(vcode);
- }
-
- } else { // 중복된 상병순서의 row가 없는 경우
- fSortDiagNo(false); // 현재 부여된 순번으로 sort 후
- fDiagGridInsertRow("Y", "N"); // 상병마지막 그리드에 한 20090918 정승우
- }
- } else { // 순번을 삭제한 경우
- model.setValue(grd_cldihist.nodeset + "["+ row +"]/diagseq", oldseq);
- grd_cldihist.rowstatus(row) = model.getValue("/root/hidden/list1/cldi/oldrowstat");
- //model.refresh();
- grd_cldihist.refresh();
- fDiagGridInsertRow("Y", "N"); // 상병마지막 그리드에 한
- }
- }
-
- // 상병 Grid 마우스 오른쪽 버튼 클릭시 팝업 메뉴 "행 삽입"
- function fDiagGridInsertRow(addyn, selectyn) {
- var iInsertRow = 0;
- if (grd_cldihist.rows == 1 || addyn == "Y") {
- iInsertRow = grd_cldihist.row;
- grd_cldihist.addRow(true, false);
- } else {
- iInsertRow = grd_cldihist.row;
- grd_cldihist.insertRow(iInsertRow, "below", true);
- }
-
- var nowRow = 0;
- nowRow = grd_cldihist.row;
-
- model.setValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/diagkindcd", "C");
- model.setValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/diagseq", grd_cldihist.row);
- // 청구과, 진료개시일은 주상병을 기준으로 부여한다.
- var clamdeptcd = model.getValue(grd_cldihist.nodeset + "/clamdeptcd");
- if (clamdeptcd == "") { // 주상병의 진료과가 입력되지 않은 경우 인적사항의 청구과를 입력한다.
- clamdeptcd = model.getValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/clamdeptcd");
- }
- model.setValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/clamdeptcd", clamdeptcd);
- var ordfromdd = model.getValue(grd_cldihist.nodeset + "/ordfromdd");
- if (ordfromdd) {
- model.setValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/ordfromdd", ordfromdd);
- } else {
- model.setValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/ordfromdd", model.getValue(grd_diaghistlist.nodetset + "[" + grd_diaghistlist.row + "]/ordfromdd"));
- }
- model.setValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/toot", "-");
- model.setValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/vcode", ""); // 20100308 추가
- // 상병이력조회에서 호출된 경우가 아니면
- if (selectyn != "Y") {
- fSortDiagNo(true);
- }
-
- // edit mode 설정위한것임 절대 지우지 말것.
- grd_cldihist.refresh();
-
- if (addyn != "Y") {
- grd_cldihist.row = nowRow;
- grd_cldihist.col = grd_cldihist.colRef("diagcd");
- grd_cldihist.dispatch("onentercell");
- }
-
- }
-
-
- // 상병 Grid 마우스 오른쪽 버튼 클릭시 팝업 메뉴 "행 추가"
- function fDiagGridAddRow() {
-
- grd_cldihist.insertRow(grd_cldihist.rows - 1, "below", false);
- model.setValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/diagkindcd", "C");
- model.setValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/diagseq", grd_cldihist.row);
- // 청구과, 진료개시일은 주상병을 기준으로 부여한다.
- var clamdeptcd = model.getValue(grd_cldihist.nodeset + "/clamdeptcd");
- if (clamdeptcd == "") { // 주상병의 진료과가 입력되지 않은 경우 인적사항의 청구과를 입력한다.
- clamdeptcd = model.getValue(grd_cldihist.nodeset + "/clamdeptcd");
- }
- model.setValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/clamdeptcd", clamdeptcd);
- var ordfromdd = model.getValue(grd_cldihist.nodeset + "/ordfromdd");
- if (ordfromdd) {
- model.setValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/ordfromdd", ordfromdd);
- } else {
- model.setValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/ordfromdd", model.getValue(grd_diaghistlist.nodeset + "[" + grd_diaghistlist.row + "]/ordfromdd"));
- }
- model.setValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/toot", "-");
- model.setValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/vcode", ""); // 20100308 추가
-
- grd_cldihist.refresh();
-
- fSortDiagNo(true);
-
- // edit mode 설정위한것임 절대 지우지 말것.
- grd_cldihist.refresh();
-
- grd_cldihist.row = grd_cldihist.rows -1;
- grd_cldihist.col = grd_cldihist.colRef("diagcd");
- grd_cldihist.dispatch("onentercell");
-
- }
-
- // 상병 Grid 마우스 오른쪽 버튼 클릭시 팝업 메뉴 "행 추가(5줄)"
- function fDiagGridInsertRowMulti() {
- for (var i = 1; i <= 5; i++) {
- grd_cldihist.insertRow(grd_cldihist.rows - 1, "below", false);
- model.setValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/diagkindcd", "C");
- model.setValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/diagseq", grd_cldihist.row);
- // 청구과, 진료개시일은 주상병을 기준으로 부여한다.
- var clamdeptcd = model.getValue(grd_cldihist.nodeset + "/clamdeptcd");
- if (clamdeptcd == "") { // 주상병의 진료과가 입력되지 않은 경우 인적사항의 청구과를 입력한다.
- clamdeptcd = model.getValue(grd_cldihist.nodeset + "/clamdeptcd");
- }
- model.setValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/clamdeptcd", clamdeptcd);
- var ordfromdd = model.getValue(grd_cldihist.nodeset + "/ordfromdd");
- if (ordfromdd) {
- model.setValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/ordfromdd", ordfromdd);
- } else {
- model.setValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/ordfromdd", model.getValue(grd_diaghistlist.nodeset + "[" + grd_diaghistlist.row + "]/ordfromdd"));
- }
- model.setValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/toot", "-");
- model.setValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/vcode", ""); // 20100308 추가
- }
- grd_cldihist.refresh();
-
- fSortDiagNo(true);
-
- // edit mode 설정위한것임 절대 지우지 말것.
- grd_cldihist.refresh();
-
- grd_cldihist.row = grd_cldihist.rows - 5;
- grd_cldihist.col = grd_cldihist.colRef("diagcd");
- grd_cldihist.dispatch("onentercell");
-
- }
-
-
- // 상병 Grid 마우스 오른쪽 버튼 클릭시 팝업 메뉴 "행 삭제"
- function fDiagGridDeleteRow() {
- // 여러 row를 동시에 선택하고 삭제하는 기능을 부여한다.
- for (var i = 0; i < grd_cldihist.selectedRows; i++) {
- var row = grd_cldihist.selectedrow(i);
- var rowstatus = grd_cldihist.rowstatus(row);
- if (rowstatus == 4) { // 4 : delete
- //return;
- }
- else if ( (rowstatus == 1 || rowstatus == 3) && rowstatus != 0) { // 1 : insert, 3 : insert & new
- model.resetInstanceNode(grd_cldihist.nodeset + "["+ row +"]/diagcd");
- model.resetInstanceNode(grd_cldihist.nodeset + "["+ row +"]/diagnm");
- model.resetInstanceNode(grd_cldihist.nodeset + "["+ row +"]/diagengnm");
- grd_cldihist.deleteRow(row, false); // 해당 라인을 Grid에서 삭제한다.
- } else { // 0 : new, 2 : update
- model.setValue(grd_cldihist.nodeset + "["+ row +"]/diagseq", "D"+row);
- grd_cldihist.rowstatus(row) = 4; // 4 : delete 상태로 stat를 변경한다.
- }
- }
- fSortDiagNo(true);
- }
-
-
- // 상병 Grid 마우스 오른쪽 버튼 클릭시 팝업 메뉴 "삭제 취소"
- function fDiagGridDeleteCancel() {
- // 여러 row를 동시에 선택하고 삭제취소하는 기능을 부여한다.
- for (var i = 0; i < grd_cldihist.selectedRows; i++) {
- var row = grd_cldihist.selectedrow(i);
- var rowstatus = grd_cldihist.rowstatus(row);
- if (rowstatus == 4) { // 4 : delete
- grd_cldihist.rowstatus(row) = 2 // 2 : update 상태로 stat를 변경한다.
- }
- }
- fSortDiagNo(true);
- }
- // 상병코드를 조회하여 해당 정보를 표시하거나 상병코드 조회용 Popup을 호출한다.
- function fSearchDiageCode() {
- var row = grd_cldihist.row;
- var diagcd = model.getValue(grd_cldihist.nodeset + "["+ row +"]/diagcd");
- if (diagcd) {
- model.removeNodeset("/root/hidden/sppiz00400/rslt");
- // 상병 Data가 2007년 이후로 설정되어 있으므로 임시로 현재 날짜를 넘긴다.
- //model.makeValue("/root/hidden/sppiz00400/cond/basedd", model.getValue("/root/main/item1/clbs/clamym"));
- model.resetInstanceNode("/root/hidden/sppiz00400/cond");
- model.makeValue("/root/hidden/sppiz00400/cond/basedd", getCurrentDate()); // (dateHelper.js) 현재날짜 반환
- model.makeValue("/root/hidden/sppiz00400/cond/diagcd", diagcd);
- model.makeValue("/root/hidden/sppiz00400/cond/diagnm", "");
- model.makeValue("/root/hidden/sppiz00400/cond/selectedrdodiagkind","1");
- submit("TRPID20306"); // 입력된 상병코드로 emr.mrtmicd10 테이블을 조회한다.
- /*
- var nodeList = instance1.selectNodes("/root/init/diagcd/diagcdlist[diagcd='" + diagcd + "']");
- if (nodeList.length == 1) {
- //model.makeNode("/root/hidden/srchdiagcd");
- //model.copyNode("/root/hidden/srchdiagcd", nodeList);
- var diagListCSV = getNodeListCSV(nodeList);
-
- diagList1 = diagListCSV.split("▩");
- diagList2 = diagList1[1].split("▦");
- model.makeValue("/root/hidden/sppiz00400/rslt/diagcd", diagList2[0]);
- model.makeValue("/root/hidden/sppiz00400/rslt/diaghngnm", diagList2[1]);
- model.makeValue("/root/hidden/sppiz00400/rslt/diagengnm", diagList2[2]);
- }
- */
-
- var rsltList = instance1.selectSingleNode("/root/hidden/sppiz00400/rslt");
- if (rsltList != null && rsltList.length == 0) {
- // 조회된 결과가 1건이면
- fSetDiagCdNm();
- // 다음칸에 자동 포커스 2008-11-26
- row++;
- grd_cldihist.row = row;
- grd_cldihist.col = grd_cldihist.colRef("diagcd");
- grd_cldihist.dispatch("onentercell");
- } else {
- // 조회된 결과가 없거나 여러 건이면
- // 상병코드 조회를 위해 SPPIZ00400_상병코드조회.xrw 를 호출한다.
- fSearchSPPIZ00400();
-
- if (model.getValue(grd_cldihist.nodeset + "["+ row +"]/diagnm") == "" && model.getValue(grd_cldihist.nodeset + "["+ row +"]/diagengnm") == "") {
- model.setValue(grd_cldihist.nodeset + "["+ row +"]/diagcd", model.getValue("/root/hidden/list1/cldi/olddiagcd"));
- model.setValue(grd_cldihist.nodeset + "["+ row +"]/diagnm", model.getValue("/root/hidden/list1/cldi/olddiagnm"));
- model.setValue(grd_cldihist.nodeset + "["+ row +"]/diagengnm", model.getValue("/root/hidden/list1/cldi/oldengnm"));
- grd_cldihist.rowstatus(row) = model.getValue("/root/hidden/list1/cldi/oldrowstat");
- grd_cldihist.refresh();
- return;
- } else {
- // 다음칸에 자동 포커스 2008-11-26
- row++;
- if (row < grd_cldihist.rows) {
- grd_cldihist.row = row;
- grd_cldihist.col = grd_cldihist.colRef("diagcd");
- grd_cldihist.dispatch("onentercell");
- }
- }
- }
- } else {
- // 상병 Grid에 상병코드를 입력하지 않고 Enter 친 경우
- // 상병코드 조회를 위해 SPPIZ00400_상병코드조회.xrw 를 호출한다.
- fSearchSPPIZ00400();
-
- // 다음칸에 자동 포커스 2008-11-26
- row++;
- grd_cldihist.row = row;
- grd_cldihist.col = grd_cldihist.colRef("diagcd");
- grd_cldihist.dispatch("onentercell");
-
- if (model.getValue(grd_cldihist.nodeset + "["+ row +"]/diagcd") == "") {
- model.setValue(grd_cldihist.nodeset + "["+ row +"]/diagcd", model.getValue("/root/hidden/list1/cldi/olddiagcd"));
- model.setValue(grd_cldihist.nodeset + "["+ row +"]/diagnm", model.getValue("/root/hidden/list1/cldi/olddiagnm"));
- model.setValue(grd_cldihist.nodeset + "["+ row +"]/diagengnm", model.getValue("/root/hidden/list1/cldi/oldengnm"));
- grd_cldihist.rowstatus(row) = model.getValue("/root/hidden/list1/cldi/oldrowstat");
- grd_cldihist.refresh();
- return;
- }
- }
- // 삭제 상태였던 상병코드를 조회하여 수정한 경우를 위해 순번을 다시 부여한다.
- // 2008-11-26
- // fSortDiagNo(true);
- }
-
-
- // 상병코드 조회를 위해 SPPIZ00400_상병코드조회.xrw 를 호출한다.
- function fSearchSPPIZ00400() {
- model.removeNodeset("/root/hidden/sppiz00400/rslt");
- model.makeNode("/root/hidden/sppiz00400/rslt/diagcd");
- model.makeNode("/root/hidden/sppiz00400/rslt/diaghngnm");
- model.makeNode("/root/hidden/sppiz00400/rslt/diagengnm");
-
- model.resetInstanceNode("/root/hidden/sppiz00400/cond");
- model.setValue("/root/hidden/sppiz00400/cond/basedd", getCurrentDate()); // (dateHelper.js) 현재날짜 반환
- model.setValue("/root/hidden/sppiz00400/cond/diagcd", model.getValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/diagcd"));
- model.setValue("/root/hidden/sppiz00400/cond/diagnm", "");
- model.setValue("/root/hidden/sppiz00400/cond/selectedrdodiagkind","3"); // 사용자가 직접검색하여 입력 할수 있도록 임의의 값(3)을 넣어줌
- modal("SPPIZ00400", "1", "10", "10", "SPPIZ00400", "/root/hidden/sppiz00400/cond", "/root/init", "", ""); // SPPIZ00400_상병코드조회.xrw
- }
-
-
- // [SPPIZ00400_상병코드조회.xrw 에서 호출] 상병코드조회 팝업에서 선택한 상병을 상병 그리드에 반영
- function fSetDiagCdNm() {
- var row = grd_cldihist.row;
- if (row > 0) {
- var diagcd = model.getValue("/root/hidden/sppiz00400/rslt/diagcd");
- var diaghngnm = model.getValue("/root/hidden/sppiz00400/rslt/diaghngnm");
- var diagengnm = model.getValue("/root/hidden/sppiz00400/rslt/diagengnm");
- model.setValue(grd_cldihist.nodeset + "["+ row +"]/diagcd", diagcd);
- model.setValue(grd_cldihist.nodeset + "["+ row +"]/diagnm", diaghngnm);
- model.setValue(grd_cldihist.nodeset + "["+ row +"]/diagengnm", diagengnm);
- // 해당 상병의 한글상병명과 영문상병명이 Message 용 output 컨트롤에 표시된다.
- model.setValue("/root/hidden/list3/msgspclformat", "상병코드 - "+ diagcd +" / "+ diaghngnm +" / "+ diagengnm);
-
- // 20100308 특정내역 조회 추가
- model.setValue(grd_cldihist.nodeset + "["+ row +"]/vcode", fGetDiagVcode(diagcd));
- // 20100329 MT002 입력체크
- if ( model.getValue(grd_cldihist.nodeset + "["+ row +"]/diagseq") == "1"
- && model.getValue(grd_cldihist.nodeset + "["+ row +"]/vcode") != ""
- ) {
- fSetDiagMT002(model.getValue(grd_cldihist.nodeset + "["+ row +"]/vcode"));
- }
- //20090918 정승우 행추가
- var addval1 = model.getValue("/root/main/list1/diag["+ row +"]/rowstat");
- var addval2 = grd_cldihist.rowstatus(row);
-
- var rowstatus = grd_cldihist.rowstatus(row);
- if (rowstatus != 1 && rowstatus != 3) { // 1 : insert, 3 : insert & new
- grd_cldihist.rowstatus(row) = 2; // 2 : update
- }
- // 4. 빈 row에 대한 입력은 행 추가를 발생시킨다. (그외에는 행추가가 일어나지 않는다.)
- //20090918 정승우 행추가
- if (addval1 == "" && (addval2 == 1 || addval2 == 3)) fDiagGridInsertRow("Y", "N");
-
- }
- }
-
-
- // 20100329 김용민 추가 상병row 로 MT002 입력
- // incode null 경우는 주상병의 특정기호 체크, null아니면 바로입력체크
- function fSetDiagMT002(incode) {
- var gridrowstatus = "";
- var existsyn = "N";
- var vcode = "";
-
- if ( incode == "" ) {
- for (var i = 1; i < grd_cldihist.rows; i++) {
- if ( grd_cldihist.rowHidden(i) == false
- && model.getValue(grd_cldihist.nodeset + "["+ i +"]/diagseq") == "1"
- && model.getValue(grd_cldihist.nodeset + "["+ i +"]/vcode") != ""
- ) {
- vcode = model.getValue(grd_cldihist.nodeset + "["+ i +"]/vcode")
- break;
- }
- }
- } else {
- vcode = incode;
- }
-
- if ( vcode != "" ) {
- for (var i = 1; i < grd_clsphist.rows; i++) {
- spclcd = model.getValue("/root/main/list3/clsp["+ i +"]/spclcd");
- spclspec = model.getValue("/root/main/list3/clsp["+ i +"]/spclspec");
- gridrowstatus = grd_clsphist.rowstatus(i);
-
- if ( vcode == spclspec && spclcd == "MT002" && gridrowstatus != 4 ) {
- existsyn = "Y";
- }
- }
- if ( existsyn != "Y" ) {
- var ans = messageBox( vcode + " 상병입니다.\n\n"
- + "MT002 특정내역을 \n\n"
- + "입력"
- , "S001");
- if ( ans == 6 ) { // yes
- var clsprow = grd_clsphist.rows - 1; // 특정내역 Grid 가장 마지막 줄에 추가한다.
- grd_clsphist.insertRow(clsprow++, true);
- model.setValue("/root/main/list3/clsp["+ clsprow +"]/unitflag", "M");
- model.setValue("/root/main/list3/clsp["+ clsprow +"]/edilnno", 0);
- model.setValue("/root/main/list3/clsp["+ clsprow +"]/snglcalcscorcd", "-");
- model.setValue("/root/main/list3/clsp["+ clsprow +"]/spclcd", "MT002");
- model.setValue("/root/main/list3/clsp["+ clsprow +"]/cdnm", "특정기호");
- model.setValue("/root/main/list3/clsp["+ clsprow +"]/spclspec", vcode);
- model.setValue("/root/main/list3/clsp["+ clsprow +"]/spclformat", "X(4)");
- model.setValue("/root/main/list3/clsp["+ clsprow +"]/detldesc", "");
- model.setValue("/root/main/list3/clsp["+ clsprow +"]/oldedilnno", "");
- model.setValue("/root/main/list3/clsp["+ clsprow +"]/clodseqno", "");
- // 특정내역 줄번호/특정코드에 따라 sorting 작업
- fSortSpclNo();
- grd_clsphist.refresh();
- }
- }
- }
- }
- // 20100308 김용민 추가 (상병코드로 특정기호 조회)
- function fGetDiagVcode(diagcd) {
- var vcode = "";
- var spclcd = "";
- var spclspec = "";
- var gridrowstatus = "";
- var existsyn = "N";
- model.removeNodeset("/root/hidden/getvcode");
- model.makeValue("/root/hidden/getvcode/cond/diagcd" ,diagcd);
- model.makeValue("/root/hidden/getvcode/cond/ioflag" ,model.getValue(grd_diaghistlist.nodeset + "[" + grd_diaghistlist.row + "]/ioflagcd"));
- model.makeValue("/root/hidden/getvcode/cond/insukind" ,model.getValue(grd_diaghistlist.nodeset + "[" + grd_diaghistlist.row + "]/insukindcd"));
- model.makeValue("/root/hidden/getvcode/cond/suppkind" ,model.getValue(grd_diaghistlist.nodeset + "[" + grd_diaghistlist.row + "]/suppkindcd"));
- model.makeValue("/root/hidden/getvcode/cond/ordfromdd",model.getValue(grd_diaghistlist.nodeset + "[" + grd_diaghistlist.row + "]/ordfromdd"));
-
- model.makeValue("/root/hidden/getvcode/rslt/vcode","");
- submit("TRPID20313"); // 상병코드로 특정기호 조회
- vcode = model.getValue("/root/hidden/getvcode/rslt/vcode")
- /*
- //////////////////////////////////////////
- // 반환전에 특정내역 입력한다.
- //////////////////////////////////////////
- if ( vcode != "" ) {
- for (var i = 1; i < grd_clsphist.rows; i++) {
- spclcd = model.getValue("/root/main/list3/clsp["+ i +"]/spclcd");
- spclspec = model.getValue("/root/main/list3/clsp["+ i +"]/spclspec");
- gridrowstatus = grd_clsphist.rowstatus(i);
-
- if ( vcode == spclspec && spclcd == 'MT002' && gridrowstatus != 4 ) {
- existsyn = "Y";
- }
- }
- if ( existsyn != "Y" ) {
- var ans = messageBox( vcode + " 상병입니다.\n\n"
- + "MT002 특정내역을 \n\n"
- + "입력"
- , "S001");
- if ( ans == 6 ) { // yes
- var clsprow = grd_clsphist.rows - 1; // 특정내역 Grid 가장 마지막 줄에 추가한다.
- grd_clsphist.insertRow(clsprow++, true);
- model.setValue("/root/main/list3/clsp["+ clsprow +"]/unitflag", "M");
- model.setValue("/root/main/list3/clsp["+ clsprow +"]/edilnno", 0);
- model.setValue("/root/main/list3/clsp["+ clsprow +"]/snglcalcscorcd", "-");
- model.setValue("/root/main/list3/clsp["+ clsprow +"]/spclcd", "MT002");
- model.setValue("/root/main/list3/clsp["+ clsprow +"]/cdnm", "특정기호");
- model.setValue("/root/main/list3/clsp["+ clsprow +"]/spclspec", vcode);
- model.setValue("/root/main/list3/clsp["+ clsprow +"]/spclformat", "X(4)");
- model.setValue("/root/main/list3/clsp["+ clsprow +"]/detldesc", "");
- model.setValue("/root/main/list3/clsp["+ clsprow +"]/oldedilnno", "");
- model.setValue("/root/main/list3/clsp["+ clsprow +"]/clodseqno", "");
- // 특정내역 줄번호/특정코드에 따라 sorting 작업
- fSortSpclNo();
- grd_clsphist.refresh();
- }
- }
- }
- //////////////////////////////////////////
- */
- return vcode;
- }
-
-
- ///////////////////////////////////////////////////////////////////////////
- // 팝업 화면 호출
- function fLinkPopMenu(trgtWindow, cond, send) {
-
- var trgtManWindow = getChildWindow(trgtWindow);
- if (trgtManWindow == null) {
- var childCnt = window.children.length;
- if (childCnt < 4) {
- open(trgtWindow, "2", "10", "10", trgtWindow, cond, send, "", "");
- } else {
- messageBox("최대 4개의 팝업 화면을 표시할 수 있으니 현재 열려있는 화면을", "I007"); ///최대 4개의 팝업 화면을 표시할 수 있으니 현재 열려있는 화면을 확인하십시오.
- }
- } else {
- activateChild(trgtWindow);
- }
- }
- // 상병코드 조회를 위해 SPPIZ00400_상병코드조회.xrw 를 호출한다.
- function fSearchSPPIZ00400() {
- model.removeNodeset("/root/hidden/sppiz00400/rslt");
- model.makeNode("/root/hidden/sppiz00400/rslt/diagcd");
- model.makeNode("/root/hidden/sppiz00400/rslt/diaghngnm");
- model.makeNode("/root/hidden/sppiz00400/rslt/diagengnm");
- model.makeNode("/root/hidden/sppiz00400/cond");
-
- model.resetInstanceNode("/root/hidden/sppiz00400/cond");
- model.makeValue("/root/hidden/sppiz00400/cond/basedd", getCurrentDate()); // (dateHelper.js) 현재날짜 반환
- model.makeValue("/root/hidden/sppiz00400/cond/diagcd", model.getValue(grd_cldihist.nodeset + "["+ grd_cldihist.row +"]/diagcd"));
- model.makeValue("/root/hidden/sppiz00400/cond/diagnm", "");
- model.makeValue("/root/hidden/sppiz00400/cond/selectedrdodiagkind","3"); // 사용자가 직접검색하여 입력 할수 있도록 임의의 값(3)을 넣어줌
- modal("SPPIZ00400", "1", "10", "10", "SPPIZ00400", "/root/hidden/sppiz00400/cond", "/root/init", "", ""); // SPPIZ00400_상병코드조회.xrw
- }
-
-
- // [SPPIZ00400_상병코드조회.xrw 에서 호출] 상병코드조회 팝업에서 선택한 상병을 상병 그리드에 반영
- function fSetDiagCdNm() {
- var row = grd_cldihist.row;
- if (row > 0) {
- var diagcd = model.getValue("/root/hidden/sppiz00400/rslt/diagcd");
- var diaghngnm = model.getValue("/root/hidden/sppiz00400/rslt/diaghngnm");
- var diagengnm = model.getValue("/root/hidden/sppiz00400/rslt/diagengnm");
- model.setValue(grd_cldihist.nodeset + "["+ row +"]/diagcd", diagcd);
- model.setValue(grd_cldihist.nodeset + "["+ row +"]/diagnm", diaghngnm);
- model.setValue(grd_cldihist.nodeset + "["+ row +"]/diagengnm", diagengnm);
- model.setValue(grd_cldihist.nodeset + "["+ row +"]/clamdeptcd", model.getValue(grd_diaghistlist.nodeset + "[" + grd_diaghistlist.row + "]/clamdeptcd"));
- model.setValue(grd_cldihist.nodeset + "["+ row +"]/ordfromdd", model.getValue(grd_diaghistlist.nodeset + "[" + grd_diaghistlist.row + "]/ordfromdd"));
- // 해당 상병의 한글상병명과 영문상병명이 Message 용 output 컨트롤에 표시된다.
- // model.setValue("/root/hidden/list3/msgspclformat", "상병코드 - "+ diagcd +" / "+ diaghngnm +" / "+ diagengnm);
-
- // 20100308 특정내역 조회 추가
- model.setValue(grd_cldihist.nodeset + "["+ row +"]/vcode", fGetDiagVcode(diagcd));
- // 20100329 MT002 입력체크
- if ( model.getValue(grd_cldihist.nodeset + "["+ row +"]/diagseq") == "1"
- && model.getValue(grd_cldihist.nodeset + "["+ row +"]/vcode") != ""
- ) {
- fSetDiagMT002(model.getValue(grd_cldihist.nodeset + "["+ row +"]/vcode"));
- }
- //20090918 정승우 행추가
- var addval1 = model.getValue(grd_cldihist.nodeset + "["+ row +"]/rowstat");
- var addval2 = grd_cldihist.rowstatus(row);
-
- var rowstatus = grd_cldihist.rowstatus(row);
- if (rowstatus != 1 && rowstatus != 3) { // 1 : insert, 3 : insert & new
- grd_cldihist.rowstatus(row) = 2; // 2 : update
- }
- // 4. 빈 row에 대한 입력은 행 추가를 발생시킨다. (그외에는 행추가가 일어나지 않는다.)
- //20090918 정승우 행추가
- if (addval1 == "" && (addval2 == 1 || addval2 == 3)) fDiagGridInsertRow("Y", "N");
-
- }
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // 상병 및 처방 치식 입력
- function fDiagOrderToothInput(flag) {
- if (flag == "Diag") {
- var row = grd_cldihist.row;
- var diagcd = model.getValue(grd_cldihist.nodeset + "["+ row +"]/diagcd");
- if (diagcd) {
- model.makeValue("/root/hidden/sppiz00600/cond/clamym", model.getValue(grd_diaghistlist.nodeset + "[" + grd_diaghistlist.row + "]/clamym"));
- model.makeValue("/root/hidden/sppiz00600/cond/clamdg", model.getValue(grd_diaghistlist.nodeset + "[" + grd_diaghistlist.row + "]/clamdg"));
- model.makeValue("/root/hidden/sppiz00600/cond/pid", model.getValue(grd_diaghistlist.nodeset + "[" + grd_diaghistlist.row + "]/pid"));
- model.makeValue("/root/hidden/sppiz00600/cond/pidsn", model.getValue(grd_diaghistlist.nodeset + "[" + grd_diaghistlist.row + "]/pidsn"));
- model.makeValue("/root/hidden/sppiz00600/cond/indd", model.getValue(grd_diaghistlist.nodeset + "[" + grd_diaghistlist.row + "]/indd"));
- model.makeValue("/root/hidden/sppiz00600/cond/cretno", model.getValue(grd_diaghistlist.nodeset + "[" + grd_diaghistlist.row + "]/cretno"));
- model.makeValue("/root/hidden/sppiz00600/cond/toot", model.getValue(grd_cldihist.nodeset + "[" + row + "]/toot"));
- fSetToothPop(row, "1");
- model.removeNodeset("/root/hidden/sppiz00600/rslt"); // SPPIZ00600_상병및처방별치식 에서 선택된 결과가 copyNode되는 경로임
- modal("SPPIZ00600", "1", "10", "10", "SPPIZ00600", "/root/hidden/sppiz00600/cond", "/root/hidden/cond", "", ""); // SPPIZ00600_상병및처방별치식.xrw
- fGetToothPop();
- }
- }
- else if (flag == "Order") {
- var row = grd_clodhist.row;
- var edilnno = model.getValue("/root/main/list2/clod["+ row +"]/edilnno");
- if (edilnno) {
- model.setValue("/root/hidden/sppiz00600/cond/clamym", model.getValue("/root/main/item1/clbs/clamym"));
- model.setValue("/root/hidden/sppiz00600/cond/clamdg", model.getValue("/root/main/item1/clbs/clamdg"));
- model.setValue("/root/hidden/sppiz00600/cond/pid", model.getValue("/root/main/item1/clbs/pid"));
- model.setValue("/root/hidden/sppiz00600/cond/pidsn", model.getValue("/root/main/item1/clbs/pidsn"));
- model.setValue("/root/hidden/sppiz00600/cond/indd", model.getValue("/root/main/item1/clbs/indd"));
- model.setValue("/root/hidden/sppiz00600/cond/cretno", model.getValue("/root/main/item1/clbs/cretno"));
- model.setValue("/root/hidden/sppiz00600/cond/toot", model.getValue("/root/main/list2/clod["+ row +"]/toot"));
- fSetToothPop(row, "2");
- model.removeNodeset("/root/hidden/sppiz00600/rslt"); // SPPIZ00600_상병및처방별치식 에서 선택된 결과가 copyNode되는 경로임
- modal("SPPIZ00600", "1", "10", "10", "SPPIZ00600", "/root/hidden/sppiz00600/cond", "/root/hidden/cond", "", ""); // SPPIZ00600_상병및처방별치식.xrw
- fGetToothPop();
- }
- }
- }
-
- //대상자에서 치식자동팝업체크시 타는 로직
- function fDiagOrderToothInputDiret(flag) {
-
- var trgtManWindow = getChildWindow("SPPIZ00600ML"); // SPPIZ00600_상병및처방별치식.xrw
- var row = "1";
- if (flag == "Diag") {
-
- //var diagcd = model.getValue("/root/main/list1/cldi["+ row +"]/diagcd");
- //if (diagcd) {
- model.setValue("/root/hidden/sppiz00600/cond/clamym", model.getValue("/root/main/item1/clbs/clamym"));
- model.setValue("/root/hidden/sppiz00600/cond/clamdg", model.getValue("/root/main/item1/clbs/clamdg"));
- model.setValue("/root/hidden/sppiz00600/cond/pid", model.getValue("/root/main/item1/clbs/pid"));
- model.setValue("/root/hidden/sppiz00600/cond/pidsn", model.getValue("/root/main/item1/clbs/pidsn"));
- model.setValue("/root/hidden/sppiz00600/cond/indd", model.getValue("/root/main/item1/clbs/indd"));
- model.setValue("/root/hidden/sppiz00600/cond/cretno", model.getValue("/root/main/item1/clbs/cretno"));
- model.setValue("/root/hidden/sppiz00600/cond/toot", model.getValue("/root/main/list1/cldi["+ row +"]/toot"));
- model.setValue("/root/hidden/sppiz00600/cond/popyn", "SMPID20500");
- fSetToothPop(row, "1");
- model.removeNodeset("/root/hidden/sppiz00600/rslt"); // SPPIZ00600_상병및처방별치식 에서 선택된 결과가 copyNode되는 경로임
- if ( trgtManWindow == null ) {
- //open("SPPIZ00600", "1", "10", "10", "SPPIZ00600", "/root/hidden/sppiz00600/cond", "/root/hidden/cond", "", ""); // SPPIZ00600_상병및처방별치식.xrw
- //open("SPPIZ00600", "2", "10", "10", "SPPIZ00600", "/root/hidden/sppiz00600/cond", "/root/hidden/cond", "", ""); // SPPIZ00600_상병및처방별치식.xrw
- open("SPPIZ00600", "2", "10", "10", "SPPIZ00600ML", "/root/hidden/sppiz00600/cond", "/root/hidden/cond", "", ""); // SPPIZ00600_상병및처방별치식.xrw
- } else {
- trgtManWindow.model.copyNode("/root/hidden/cond",root.hidden.sppiz00600.cond);
- activateChild("SPPIZ00600ML");
- trgtManWindow.javascript.fInitialize();
- }
- //fGetToothPop(); // 모달리스 타입이라..여기선 의미없음
- //}
- }
-
- }
-
-
- // 현재 상병, 처방 Grid 상에서 입력상태의 치식을 팝업 화면에 전달하기 위해 리스트 형태로 만든다.
- function fSetToothPop(row, flag) {
- model.removeNodeset("/root/hidden/sppiz00600/cond/list");
- model.makeNode("/root/hidden/sppiz00600/cond/list");
- // model.resetInstanceNode("/root/hidden/sppiz00600/cond/list");
- // 상병
- var cntcldi = getNodesetCount(grd_cldihist.nodeset);
- // 처방
- // var cntclod = getNodesetCount("/root/main/list2/clod");
- // grd_clodhist.rows는 타이틀을 포함하지만 getNodesetCount는 타이틀을 제외한 data 갯수를 반환
- var cd = "";
- var cdnm = "";
- var orddd = "";
- var toot = "";
- var rowcnt = 1;
- // for (i=1; i<cntcldi; i++) {
- for (var i = 1; i <= cntcldi; i++) {
- cd = model.getValue(grd_cldihist.nodeset + "["+ i + "]/diagcd");
- cdnm = model.getValue(grd_cldihist.nodeset + "["+ i + "]/diagnm");
- orddd = model.getValue(grd_cldihist.nodeset + "["+ i + "]/ordfromdd");
- toot = model.getValue(grd_cldihist.nodeset + "["+ i + "]/toot");
-
- if (toot != "-" && toot != "" && toot != " ") {
- var milktoothstr = "ABCDE000";
- var subTootStr = "";
-
- for (var inx = 0; inx < 32; inx++) {
- var tootnum = toot.substr(inx,1);
- if (tootnum == "*") { // 선택된 영구치의 경우 1~8 사이 숫자로 표시한다.
- if (inx < 8) {
- subTootStr += (8 - inx);
- }
- else if (inx > 7 && inx < 16) {
- subTootStr += (inx - 7);
- }
- else if (inx > 15 && inx < 24) {
- subTootStr += (24 - inx);
- } else {
- subTootStr += (inx - 23);
- }
- } else if (tootnum == "#") { // 선택된 유치의 경우 A~E 사이 알파벳으로 표시한다.
- if (inx < 8) {
- subTootStr += milktoothstr.charAt(7 - inx);
- }
- else if (inx > 7 && inx < 16) {
- subTootStr += milktoothstr.charAt(inx - 8);
- }
- else if (inx > 15 && inx < 24) {
- subTootStr += milktoothstr.charAt(23 - inx);
- } else {
- subTootStr += milktoothstr.charAt(inx - 24);
- }
- } else { // if (tootnum == "0") 선택되지 않은 경우 공백으로 처리한다.
- subTootStr += " ";
- }
- }
- model.makeNode("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/chos");
- //치식 표기를 설정한다.
- if (row == i && flag == "1") {
- model.setValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/chos", "true");
- } else {
- model.setValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/chos", "false");
- }
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/flag", "상병");
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/cd", cd);
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/cdnm", cdnm);
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/rightupper", subTootStr.substr(0, 8));
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/leftupper", subTootStr.substr(8, 8));
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/rightlower", subTootStr.substr(16, 8));
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/leftlower", subTootStr.substr(24, 8));
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/orddd", orddd);
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/toot", toot);
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/row", i);
- rowcnt = rowcnt+1;
- } else {
- if (row == i && flag == "1") {
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/chos", "true");
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/flag", "상병");
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/cd", cd);
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/cdnm", cdnm);
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/rightupper", "");
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/leftupper", "");
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/rightlower", "");
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/leftlower", "");
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/orddd", orddd);
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/toot", "");
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/row", i);
- rowcnt = rowcnt+1;
- }
- }
- }
-
- /*
- for (var i = 1; i <= cntclod; i++) {
- cd = model.getValue("/root/main/list2/clod["+ i + "]/snglcalcscorcd");
- cdnm = model.getValue("/root/main/list2/clod["+ i + "]/hngnm");
- orddd = model.getValue("/root/main/list2/clod["+ i + "]/orddd");
- toot = model.getValue("/root/main/list2/clod["+ i + "]/toot");
- estmcls = model.getValue("/root/main/list2/clod["+ i + "]/estmcls");
-
-
- if ((toot != "-" && toot != "") || estmcls == "U"){
- var milktoothstr = "ABCDE000";
- var subTootStr = "";
-
- var tmpStr = "";
- for (var inx = 0; inx < 32; inx++) {
- var tootnum = toot.substr(inx,1);
- if (tootnum == "*") { // 선택된 영구치의 경우 1~8 사이 숫자로 표시한다.
- if (inx < 8) {
- subTootStr += (8 - inx);
- }
- else if (inx > 7 && inx < 16) {
- subTootStr += (inx - 7);
- }
- else if (inx > 15 && inx < 24) {
- subTootStr += (24 - inx);
- } else {
- subTootStr += (inx - 23);
- }
- } else if (tootnum == "#") { // 선택된 유치의 경우 A~E 사이 알파벳으로 표시한다.
- if (inx < 8) {
- subTootStr += milktoothstr.charAt(7 - inx);
- }
- else if (inx > 7 && inx < 16) {
- subTootStr += milktoothstr.charAt(inx - 8);
- }
- else if (inx > 15 && inx < 24) {
- subTootStr += milktoothstr.charAt(23 - inx);
- } else {
- subTootStr += milktoothstr.charAt(inx - 24);
- }
- } else { // if (tootnum == "0") 선택되지 않은 경우 공백으로 처리한다.
- subTootStr += " ";
- }
- }
- model.makeNode("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/chos");
- //치식 표기를 설정한다.
- if (row == i && flag == "2") {
- model.setValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/chos", "true");
- } else {
- model.setValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/chos", "false");
- }
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/flag", "처방");
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/cd", cd);
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/cdnm", cdnm);
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/rightupper", subTootStr.substr(0, 8));
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/leftupper", subTootStr.substr(8, 8));
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/rightlower", subTootStr.substr(16, 8));
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/leftlower", subTootStr.substr(24, 8));
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/orddd", orddd);
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/toot", toot);
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/row", i);
- rowcnt = rowcnt+1;
- } else {
- if (row == i && flag == "2") {
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/chos", "true");
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/flag", "처방");
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/cd", cd);
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/cdnm", cdnm);
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/rightupper", "");
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/leftupper", "");
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/rightlower", "");
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/leftlower", "");
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/orddd", orddd);
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/toot", "");
- model.makeValue("/root/hidden/sppiz00600/cond/list/toothapplist[" + rowcnt + "]/row", i);
- rowcnt = rowcnt+1;
- }
- }
- }
- */
- }
- // SPPIZ00600_상병및처방별치식 선택 결과를 반영한다.
- function fGetToothPop() {
- var tootSelectcnt = getNodesetCount("/root/hidden/sppiz00600/rslt/list");
- var flag = "";
- var row = "";
- var toot = "";
- tootSelectcnt = eval(tootSelectcnt) + 1;
-
- for (var i = 1; i < tootSelectcnt; i++) {
- flag = model.getValue("/root/hidden/sppiz00600/rslt/list["+ i +"]/flag");
- row = model.getValue("/root/hidden/sppiz00600/rslt/list["+ i +"]/row");
- var rlsttoot = model.getValue("/root/hidden/sppiz00600/rslt/list["+ i +"]/toot");
- var rlsttoot1 = model.getValue("/root/hidden/sppiz00600/rslt/list["+ i +"]/toot1");
- if (rlsttoot == "") {
- rlsttoot = "-";
- }
- if (rlsttoot1 == "") {
- rlsttoot1 = "-";
- }
- if (flag == "1") {
- toot = model.getValue(grd_cldihist.nodeset + "["+ row +"]/toot");
- model.setValue(grd_cldihist.nodeset + "["+ row +"]/toot", rlsttoot);
- model.setValue(grd_cldihist.nodeset + "["+ row +"]/toot1", rlsttoot1);
- if (rlsttoot != toot) { // 치식번호가 변경된 경우
- var cldistatus = grd_cldihist.rowstatus(row);
- if (cldistatus == 0 || cldistatus == 2) { // 0 : new, 2 : update
- grd_cldihist.rowstatus(row) = 2; // 2 : update
- }
- }
- } else if (flag == "2") {
- toot = model.getValue(grd_cldihist.nodeset + "["+ row +"]/toot");
- model.setValue(grd_cldihist.nodeset + "["+ row +"]/toot", rlsttoot);
- model.setValue(grd_cldihist.nodeset + "["+ row +"]/toot1", rlsttoot1);
- if (rlsttoot != toot) { // 치식번호가 변경된 경우
- // 처방의 수정된 row 상태를 표시한다.
-
- }
- }
- }
- }
|