PMC001.js 59 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410
  1. /*
  2. * 입원등록 공통 함수
  3. * PMC001.js
  4. * 작성자 : 최병진
  5. * 작성일 : 2009.02.09
  6. * 수정이력
  7. */
  8. /* 공단자격조회
  9. *
  10. * 전제조건 : com/nhicinterfaceweb/js/ZEH001.js include 필요
  11. * Parameter : pPid - 환자번호
  12. * pHngnm - 환자성명
  13. * pRgstno - 주민번호
  14. * pDate - 조회일자
  15. * pInduCd - 기관기호
  16. * pLoginId - 공단로그인정보
  17. * pPassWord - 공단로그인정보
  18. * Return : M2 - String
  19. */
  20. function pmcfGetNhicQualification_ws(pPid, pSujinjaJuminNo, pYkiho, pSujinjaJuminNm, pDiagDt, pLoginId, pPassWord, pClientInfo, pOperatorJuminNo, pShowMsg) {
  21. model.removeNode("/root/temp/nhicrslt/m2");
  22. model.makeNode("/root/temp/nhicrslt/m2");
  23. model.makeValue("/root/send/ws/m1/sujinjajuminno", pSujinjaJuminNo);
  24. model.makeValue("/root/send/ws/m1/ykiho", pYkiho);
  25. model.makeValue("/root/send/ws/m1/sujinjajuminnm", pSujinjaJuminNm);
  26. model.makeValue("/root/send/ws/m1/diagdt", pDiagDt);
  27. model.makeValue("/root/send/ws/m1/clientinfo", pClientInfo);
  28. model.makeValue("/root/send/ws/m1/operatorjuminno", pOperatorJuminNo);
  29. // 자격 조회 WebService 호출
  30. submit("TRPAC04001", false);
  31. var cnt = instance1.selectNodes("/root/temp/nhicrslt/m2").length;
  32. if (cnt < 1) {
  33. messageBox("정보 수신 실패", "E999", "");
  34. return false;
  35. }
  36. if (document.all("grd_m2") != null) {
  37. var mPath = "/root/temp/nhicrslt/m2/";
  38. var tPath = "/root/hidden/m2list/m2info";
  39. var gPath = "/root/grd/m2list/m2info";
  40. var idx = 0;
  41. var cap = "";
  42. var val = "";
  43. // 노인틀니 대상자(상악)
  44. val = model.getValue(mPath + "denttop");
  45. if (val != "") {
  46. idx++;
  47. cap += "노인틀니(상악)^노인틀니(상악)^";
  48. model.makeValue(tPath + "[1]/itm" + idx, "등록번호");
  49. model.makeValue(tPath + "[1]/val" + idx, val.substr(0, 15));
  50. model.makeValue(tPath + "[2]/itm" + idx, "등록기관");
  51. model.makeValue(tPath + "[2]/val" + idx, val.substr(15, 8));
  52. model.makeValue(tPath + "[3]/itm" + idx, "틀니장착일");
  53. model.makeValue(tPath + "[3]/val" + idx, val.substr(23, 4) + "-" + val.substr(27, 2) + "-" + val.substr(29, 2));
  54. model.makeValue(tPath + "[4]/itm" + idx, "무상종료일");
  55. model.makeValue(tPath + "[4]/val" + idx, val.substr(31, 4) + "-" + val.substr(35, 2) + "-" + val.substr(37, 2));
  56. model.makeValue(tPath + "[5]/itm" + idx, "시작일");
  57. model.makeValue(tPath + "[5]/val" + idx, val.substr(39, 4) + "-" + val.substr(43, 2) + "-" + val.substr(45, 2));
  58. model.makeValue(tPath + "[6]/itm" + idx, "종료일");
  59. model.makeValue(tPath + "[6]/val" + idx, val.substr(47, 4) + "-" + val.substr(51, 2) + "-" + val.substr(53, 2));
  60. }
  61. // 노인틀니 대상자(하악)
  62. val = model.getValue(mPath + "dentbottom");
  63. if (val != "") {
  64. idx++;
  65. cap += "노인틀니(하악)^노인틀니(하악)^";
  66. model.makeValue(tPath + "[1]/itm" + idx, "등록번호");
  67. model.makeValue(tPath + "[1]/val" + idx, val.substr(0, 15));
  68. model.makeValue(tPath + "[2]/itm" + idx, "등록기관");
  69. model.makeValue(tPath + "[2]/val" + idx, val.substr(15, 8));
  70. model.makeValue(tPath + "[3]/itm" + idx, "틀니장착일");
  71. model.makeValue(tPath + "[3]/val" + idx, val.substr(23, 4) + "-" + val.substr(27, 2) + "-" + val.substr(29, 2));
  72. model.makeValue(tPath + "[4]/itm" + idx, "무상종료일");
  73. model.makeValue(tPath + "[4]/val" + idx, val.substr(31, 4) + "-" + val.substr(35, 2) + "-" + val.substr(37, 2));
  74. model.makeValue(tPath + "[5]/itm" + idx, "시작일");
  75. model.makeValue(tPath + "[5]/val" + idx, val.substr(39, 4) + "-" + val.substr(43, 2) + "-" + val.substr(45, 2));
  76. model.makeValue(tPath + "[5]/itm" + idx, "종료일");
  77. model.makeValue(tPath + "[5]/val" + idx, val.substr(47, 4) + "-" + val.substr(51, 2) + "-" + val.substr(53, 2));
  78. }
  79. // 임플란트 대상자정보 1
  80. val = model.getValue(mPath + "dentimpl1");
  81. if (val != "") {
  82. idx++;
  83. cap += "임플란트 1^임플란트 1^";
  84. model.makeValue(tPath + "[1]/itm" + idx, "등록번호");
  85. model.makeValue(tPath + "[1]/val" + idx, val.substr(0, 18));
  86. model.makeValue(tPath + "[2]/itm" + idx, "등록기관");
  87. model.makeValue(tPath + "[2]/val" + idx, val.substr(18, 8));
  88. model.makeValue(tPath + "[3]/itm" + idx, "최종단계시술일");
  89. model.makeValue(tPath + "[3]/val" + idx, val.substr(26, 4) + "-" + val.substr(30, 2) + "-" + val.substr(32, 2));
  90. model.makeValue(tPath + "[4]/itm" + idx, "사후점검종료일");
  91. model.makeValue(tPath + "[4]/val" + idx, val.substr(34, 4) + "-" + val.substr(38, 2) + "-" + val.substr(40, 2));
  92. model.makeValue(tPath + "[5]/itm" + idx, "시작유효일");
  93. model.makeValue(tPath + "[5]/val" + idx, val.substr(42, 4) + "-" + val.substr(46, 2) + "-" + val.substr(48, 2));
  94. model.makeValue(tPath + "[6]/itm" + idx, "상실유효일");
  95. model.makeValue(tPath + "[6]/val" + idx, val.substr(50, 4) + "-" + val.substr(54, 2) + "-" + val.substr(56, 2));
  96. }
  97. // 임플란트 대상자정보 2
  98. val = model.getValue(mPath + "dentimpl2");
  99. if (val != "") {
  100. idx++;
  101. cap += "임플란트 2^임플란트 2^";
  102. model.makeValue(tPath + "[1]/itm" + idx, "등록번호");
  103. model.makeValue(tPath + "[1]/val" + idx, val.substr(0, 18));
  104. model.makeValue(tPath + "[2]/itm" + idx, "등록기관");
  105. model.makeValue(tPath + "[2]/val" + idx, val.substr(18, 8));
  106. model.makeValue(tPath + "[3]/itm" + idx, "최종단계시술일");
  107. model.makeValue(tPath + "[3]/val" + idx, val.substr(26, 4) + "-" + val.substr(30, 2) + "-" + val.substr(32, 2));
  108. model.makeValue(tPath + "[4]/itm" + idx, "사후점검종료일");
  109. model.makeValue(tPath + "[4]/val" + idx, val.substr(34, 4) + "-" + val.substr(38, 2) + "-" + val.substr(40, 2));
  110. model.makeValue(tPath + "[5]/itm" + idx, "시작일");
  111. model.makeValue(tPath + "[5]/val" + idx, val.substr(42, 4) + "-" + val.substr(46, 2) + "-" + val.substr(48, 2));
  112. model.makeValue(tPath + "[6]/itm" + idx, "상실일");
  113. model.makeValue(tPath + "[6]/val" + idx, val.substr(50, 4) + "-" + val.substr(54, 2) + "-" + val.substr(56, 2));
  114. }
  115. // 조산아 및 저체중 출생아 등록대상자
  116. val = model.getValue(mPath + "preinfant");
  117. if (val != "") {
  118. idx++;
  119. cap += "조산아/저체중^조산아/저체중^";
  120. model.makeValue(tPath + "[1]/itm" + idx, "등록번호");
  121. model.makeValue(tPath + "[1]/val" + idx, val.substr(0, 10));
  122. model.makeValue(tPath + "[2]/itm" + idx, "시작일");
  123. model.makeValue(tPath + "[2]/val" + idx, val.substr(10, 4) + "-" + val.substr(14, 2) + "-" + val.substr(16, 2));
  124. model.makeValue(tPath + "[3]/itm" + idx, "종료일");
  125. model.makeValue(tPath + "[3]/val" + idx, val.substr(18, 4) + "-" + val.substr(22, 2) + "-" + val.substr(24, 2));
  126. }
  127. // 희귀난치대상자
  128. val = model.getValue(mPath + "disregprson1");
  129. if (val != "") {
  130. idx++;
  131. cap += "희귀난치^희귀난치^";
  132. model.makeValue(tPath + "[1]/itm" + idx, "특정기호");
  133. model.makeValue(tPath + "[1]/val" + idx, val.substr(0, 4));
  134. model.makeValue(tPath + "[2]/itm" + idx, "시작일");
  135. model.makeValue(tPath + "[2]/val" + idx, val.substr(4, 4) + "-" + val.substr(8, 2) + "-" + val.substr(10, 2));
  136. model.makeValue(tPath + "[3]/itm" + idx, "종료일");
  137. model.makeValue(tPath + "[3]/val" + idx, val.substr(12, 4) + "-" + val.substr(16, 2) + "-" + val.substr(18, 2));
  138. }
  139. // 산정특례(희귀)등록대상자
  140. val = model.getValue(mPath + "disregprson2");
  141. if (val != "") {
  142. idx++;
  143. cap += "산정특례(희귀)^산정특례(희귀)^";
  144. model.makeValue(tPath + "[1]/itm" + idx, "특정기호");
  145. model.makeValue(tPath + "[1]/val" + idx, val.substr(0, 4));
  146. model.makeValue(tPath + "[2]/itm" + idx, "등록번호");
  147. model.makeValue(tPath + "[2]/val" + idx, val.substr(4, 15));
  148. model.makeValue(tPath + "[3]/itm" + idx, "등록일");
  149. model.makeValue(tPath + "[3]/val" + idx, val.substr(19, 4) + "-" + val.substr(23, 2) + "-" + val.substr(25, 2));
  150. model.makeValue(tPath + "[4]/itm" + idx, "종료일");
  151. model.makeValue(tPath + "[4]/val" + idx, val.substr(27, 4) + "-" + val.substr(31, 2) + "-" + val.substr(33, 2));
  152. model.makeValue(tPath + "[5]/itm" + idx, "상병코드");
  153. model.makeValue(tPath + "[5]/val" + idx, val.substr(35, 10));
  154. model.makeValue(tPath + "[6]/itm" + idx, "일련번호");
  155. model.makeValue(tPath + "[6]/val" + idx, val.substr(45, 2));
  156. }
  157. // 차상위대상자
  158. val = model.getValue(mPath + "disregprson3");
  159. if (val != "") {
  160. idx++;
  161. cap += "차상위^차상위^";
  162. model.makeValue(tPath + "[1]/itm" + idx, "특정기호");
  163. model.makeValue(tPath + "[1]/val" + idx, val.substr(0, 4));
  164. model.makeValue(tPath + "[2]/itm" + idx, "시작일");
  165. model.makeValue(tPath + "[2]/val" + idx, val.substr(4, 4) + "-" + val.substr(8, 2) + "-" + val.substr(10, 2));
  166. model.makeValue(tPath + "[3]/itm" + idx, "종료일");
  167. model.makeValue(tPath + "[3]/val" + idx, val.substr(12, 4) + "-" + val.substr(16, 2) + "-" + val.substr(18, 2));
  168. model.makeValue(tPath + "[4]/itm" + idx, "종료일");
  169. model.makeValue(tPath + "[4]/val" + idx, val.substr(20, 1) + "종");
  170. }
  171. // 산정특례(암)등록대상자1
  172. val = model.getValue(mPath + "disregprson4");
  173. if (val != "") {
  174. idx++;
  175. cap += "산정특례(암) 1^산정특례(암) 1^";
  176. model.makeValue(tPath + "[1]/itm" + idx, "특정기호");
  177. model.makeValue(tPath + "[1]/val" + idx, val.substr(0, 4));
  178. model.makeValue(tPath + "[2]/itm" + idx, "등록번호");
  179. model.makeValue(tPath + "[2]/val" + idx, val.substr(4, 15));
  180. model.makeValue(tPath + "[3]/itm" + idx, "등록일");
  181. model.makeValue(tPath + "[3]/val" + idx, val.substr(19, 4) + "-" + val.substr(23, 2) + "-" + val.substr(25, 2));
  182. model.makeValue(tPath + "[4]/itm" + idx, "종료일");
  183. model.makeValue(tPath + "[4]/val" + idx, val.substr(27, 4) + "-" + val.substr(31, 2) + "-" + val.substr(33, 2));
  184. model.makeValue(tPath + "[5]/itm" + idx, "상병기호");
  185. model.makeValue(tPath + "[5]/val" + idx, val.substr(35, 10));
  186. model.makeValue(tPath + "[6]/itm" + idx, "일련번호");
  187. model.makeValue(tPath + "[6]/val" + idx, val.substr(45, 2));
  188. model.makeValue(tPath + "[7]/itm" + idx, "등록구분");
  189. var eVal = "";
  190. switch (val.substr(47, 1)) {
  191. case "1": eVal = "신규"; break;
  192. case "2": eVal = "재등록"; break;
  193. case "3": eVal = "중복암"; break;
  194. case "4": eVal = "중복암재등록"; break;
  195. default: break;
  196. }
  197. model.makeValue(tPath + "[7]/val" + idx, eVal);
  198. }
  199. // 산정특례(화상)등록대상자
  200. val = model.getValue(mPath + "disregprson5");
  201. if (val != "") {
  202. idx++;
  203. cap += "산정특례(화상)^산정특례(화상)^";
  204. model.makeValue(tPath + "[1]/itm" + idx, "특정기호");
  205. model.makeValue(tPath + "[1]/val" + idx, val.substr(0, 4));
  206. model.makeValue(tPath + "[2]/itm" + idx, "등록번호");
  207. model.makeValue(tPath + "[2]/val" + idx, val.substr(4, 15));
  208. model.makeValue(tPath + "[3]/itm" + idx, "등록일");
  209. model.makeValue(tPath + "[3]/val" + idx, val.substr(19, 4) + "-" + val.substr(23, 2) + "-" + val.substr(25, 2));
  210. model.makeValue(tPath + "[4]/itm" + idx, "종료일");
  211. model.makeValue(tPath + "[4]/val" + idx, val.substr(27, 4) + "-" + val.substr(31, 2) + "-" + val.substr(33, 2));
  212. }
  213. // 당뇨병 요양비 대상자 등록일
  214. val = model.getValue(mPath + "disregprson6");
  215. if (val != "") {
  216. idx++;
  217. cap += "당뇨병요양비^당뇨병요양비^";
  218. model.makeValue(tPath + "[1]/itm" + idx, "등록일");
  219. model.makeValue(tPath + "[1]/val" + idx, val.substr(0, 4) + "-" + val.substr(4, 2) + "-" + val.substr(6, 2));
  220. }
  221. // 동일성분 의약품 제한자
  222. val = model.getValue(mPath + "disregprson7");
  223. if (val != "") {
  224. idx++;
  225. cap += "동일성분제한^동일성분제한^";
  226. model.makeValue(tPath + "[1]/itm" + idx, "등록일");
  227. model.makeValue(tPath + "[1]/val" + idx, val.substr(0, 4) + "-" + val.substr(4, 2) + "-" + val.substr(6, 2));
  228. model.makeValue(tPath + "[2]/itm" + idx, "종료일");
  229. model.makeValue(tPath + "[2]/val" + idx, val.substr(8, 4) + "-" + val.substr(12, 2) + "-" + val.substr(14, 2));
  230. }
  231. // 자가도뇨 카테타 대상자
  232. val = model.getValue(mPath + "disregprson8");
  233. if (val != "") {
  234. idx++;
  235. cap += "자가도뇨카테타^자가도뇨카테타^";
  236. model.makeValue(tPath + "[1]/itm" + idx, "등록일");
  237. model.makeValue(tPath + "[1]/val" + idx, val.substr(0, 4) + "-" + val.substr(4, 2) + "-" + val.substr(6, 2));
  238. }
  239. // 산정특례(구결핵)등록대상자
  240. val = model.getValue(mPath + "disregprson9");
  241. if (val != "") {
  242. idx++;
  243. cap += "산정특례(구결핵)^산정특례(구결핵)^";
  244. model.makeValue(tPath + "[1]/itm" + idx, "특정기호");
  245. model.makeValue(tPath + "[1]/val" + idx, val.substr(0, 4));
  246. model.makeValue(tPath + "[2]/itm" + idx, "등록번호");
  247. model.makeValue(tPath + "[2]/val" + idx, val.substr(4, 15));
  248. model.makeValue(tPath + "[3]/itm" + idx, "등록일");
  249. model.makeValue(tPath + "[3]/val" + idx, val.substr(19, 4) + "-" + val.substr(23, 2) + "-" + val.substr(25, 2));
  250. model.makeValue(tPath + "[4]/itm" + idx, "종료일");
  251. model.makeValue(tPath + "[4]/val" + idx, val.substr(27, 4) + "-" + val.substr(31, 2) + "-" + val.substr(33, 2));
  252. }
  253. // 산정특례(극희귀)등록대상자
  254. val = model.getValue(mPath + "disregprson10");
  255. if (val != "") {
  256. idx++;
  257. cap += "산정특례(극희귀)^산정특례(극희귀)^";
  258. model.makeValue(tPath + "[1]/itm" + idx, "특정기호");
  259. model.makeValue(tPath + "[1]/val" + idx, val.substr(0, 4));
  260. model.makeValue(tPath + "[2]/itm" + idx, "등록번호");
  261. model.makeValue(tPath + "[2]/val" + idx, val.substr(4, 15));
  262. model.makeValue(tPath + "[3]/itm" + idx, "등록일");
  263. model.makeValue(tPath + "[3]/val" + idx, val.substr(19, 4) + "-" + val.substr(23, 2) + "-" + val.substr(25, 2));
  264. model.makeValue(tPath + "[4]/itm" + idx, "종료일");
  265. model.makeValue(tPath + "[4]/val" + idx, val.substr(27, 4) + "-" + val.substr(31, 2) + "-" + val.substr(33, 2));
  266. model.makeValue(tPath + "[5]/itm" + idx, "상병코드");
  267. model.makeValue(tPath + "[5]/val" + idx, val.substr(35, 10));
  268. model.makeValue(tPath + "[6]/itm" + idx, "일련번호");
  269. model.makeValue(tPath + "[6]/val" + idx, val.substr(45, 2));
  270. }
  271. // 산정특례(상세불명극희귀)등록대상자
  272. val = model.getValue(mPath + "disregprson11");
  273. if (val != "") {
  274. idx++;
  275. cap += "산정특례(상세불명희귀)^산정특례(상세불명희귀)^";
  276. model.makeValue(tPath + "[1]/itm" + idx, "특정기호");
  277. model.makeValue(tPath + "[1]/val" + idx, val.substr(0, 4));
  278. model.makeValue(tPath + "[2]/itm" + idx, "등록번호");
  279. model.makeValue(tPath + "[2]/val" + idx, val.substr(4, 15));
  280. model.makeValue(tPath + "[3]/itm" + idx, "등록일");
  281. model.makeValue(tPath + "[3]/val" + idx, val.substr(19, 4) + "-" + val.substr(23, 2) + "-" + val.substr(25, 2));
  282. model.makeValue(tPath + "[4]/itm" + idx, "종료일");
  283. model.makeValue(tPath + "[4]/val" + idx, val.substr(27, 4) + "-" + val.substr(31, 2) + "-" + val.substr(33, 2));
  284. model.makeValue(tPath + "[5]/itm" + idx, "상병코드");
  285. model.makeValue(tPath + "[5]/val" + idx, val.substr(35, 10));
  286. model.makeValue(tPath + "[6]/itm" + idx, "일련번호");
  287. model.makeValue(tPath + "[6]/val" + idx, val.substr(45, 2));
  288. }
  289. // 산정특례(신결핵)등록대상자
  290. val = model.getValue(mPath + "disregprson12");
  291. if (val != "") {
  292. idx++;
  293. cap += "산정특례(신결핵)^산정특례(신결핵)^";
  294. model.makeValue(tPath + "[1]/itm" + idx, "특정기호");
  295. model.makeValue(tPath + "[1]/val" + idx, val.substr(0, 4));
  296. model.makeValue(tPath + "[2]/itm" + idx, "등록번호");
  297. model.makeValue(tPath + "[2]/val" + idx, val.substr(4, 10));
  298. model.makeValue(tPath + "[3]/itm" + idx, "치료시작일");
  299. model.makeValue(tPath + "[3]/val" + idx, val.substr(14, 4) + "-" + val.substr(18, 2) + "-" + val.substr(20, 2));
  300. model.makeValue(tPath + "[4]/itm" + idx, "치료종료일");
  301. model.makeValue(tPath + "[4]/val" + idx, val.substr(22, 4) + "-" + val.substr(26, 2) + "-" + val.substr(28, 2));
  302. model.makeValue(tPath + "[5]/itm" + idx, "면허번호");
  303. model.makeValue(tPath + "[5]/val" + idx, val.substr(30, 10));
  304. model.makeValue(tPath + "[6]/itm" + idx, "의사성명");
  305. model.makeValue(tPath + "[6]/val" + idx, val.substr(40, 40));
  306. model.makeValue(tPath + "[7]/itm" + idx, "종료기관");
  307. model.makeValue(tPath + "[7]/val" + idx, val.substr(80, 8));
  308. }
  309. // 산정특례(중복암)등록대상자2
  310. val = model.getValue(mPath + "disregprson13");
  311. if (val != "") {
  312. idx++;
  313. cap += "산정특례(중복암) 2^산정특례(중복암) 2^";
  314. model.makeValue(tPath + "[1]/itm" + idx, "특정기호");
  315. model.makeValue(tPath + "[1]/val" + idx, val.substr(0, 4));
  316. model.makeValue(tPath + "[2]/itm" + idx, "등록번호");
  317. model.makeValue(tPath + "[2]/val" + idx, val.substr(4, 15));
  318. model.makeValue(tPath + "[3]/itm" + idx, "등록일");
  319. model.makeValue(tPath + "[3]/val" + idx, val.substr(19, 4) + "-" + val.substr(23, 2) + "-" + val.substr(25, 2));
  320. model.makeValue(tPath + "[4]/itm" + idx, "종료일");
  321. model.makeValue(tPath + "[4]/val" + idx, val.substr(27, 4) + "-" + val.substr(31, 2) + "-" + val.substr(33, 2));
  322. model.makeValue(tPath + "[5]/itm" + idx, "상병기호");
  323. model.makeValue(tPath + "[5]/val" + idx, val.substr(35, 10));
  324. model.makeValue(tPath + "[6]/itm" + idx, "일련번호");
  325. model.makeValue(tPath + "[6]/val" + idx, val.substr(45, 2));
  326. model.makeValue(tPath + "[7]/itm" + idx, "등록구분");
  327. var eVal = "";
  328. switch (val.substr(47, 1)) {
  329. case "1": eVal = "신규"; break;
  330. case "2": eVal = "재등록"; break;
  331. case "3": eVal = "중복암"; break;
  332. case "4": eVal = "중복암재등록"; break;
  333. default: break;
  334. }
  335. model.makeValue(tPath + "[7]/val" + idx, eVal);
  336. }
  337. // 산정특례(중복암)등록대상자3
  338. val = model.getValue(mPath + "disregprson14");
  339. if (val != "") {
  340. idx++;
  341. cap += "산정특례(중복암) 3^산정특례(중복암) 3^";
  342. model.makeValue(tPath + "[1]/itm" + idx, "특정기호");
  343. model.makeValue(tPath + "[1]/val" + idx, val.substr(0, 4));
  344. model.makeValue(tPath + "[2]/itm" + idx, "등록번호");
  345. model.makeValue(tPath + "[2]/val" + idx, val.substr(4, 15));
  346. model.makeValue(tPath + "[3]/itm" + idx, "등록일");
  347. model.makeValue(tPath + "[3]/val" + idx, val.substr(19, 4) + "-" + val.substr(23, 2) + "-" + val.substr(25, 2));
  348. model.makeValue(tPath + "[4]/itm" + idx, "종료일");
  349. model.makeValue(tPath + "[4]/val" + idx, val.substr(27, 4) + "-" + val.substr(31, 2) + "-" + val.substr(33, 2));
  350. model.makeValue(tPath + "[5]/itm" + idx, "상병기호");
  351. model.makeValue(tPath + "[5]/val" + idx, val.substr(35, 10));
  352. model.makeValue(tPath + "[6]/itm" + idx, "일련번호");
  353. model.makeValue(tPath + "[6]/val" + idx, val.substr(45, 2));
  354. model.makeValue(tPath + "[7]/itm" + idx, "등록구분");
  355. var eVal = "";
  356. switch (val.substr(47, 1)) {
  357. case "1": eVal = "신규"; break;
  358. case "2": eVal = "재등록"; break;
  359. case "3": eVal = "중복암"; break;
  360. case "4": eVal = "중복암재등록"; break;
  361. default: break;
  362. }
  363. model.makeValue(tPath + "[7]/val" + idx, eVal);
  364. }
  365. // 산정특례(중복암)등록대상자4
  366. val = model.getValue(mPath + "disregprson15");
  367. if (val != "") {
  368. idx++;
  369. cap += "산정특례(중복암) 4^산정특례(중복암) 4^";
  370. model.makeValue(tPath + "[1]/itm" + idx, "특정기호");
  371. model.makeValue(tPath + "[1]/val" + idx, val.substr(0, 4));
  372. model.makeValue(tPath + "[2]/itm" + idx, "등록번호");
  373. model.makeValue(tPath + "[2]/val" + idx, val.substr(4, 15));
  374. model.makeValue(tPath + "[3]/itm" + idx, "등록일");
  375. model.makeValue(tPath + "[3]/val" + idx, val.substr(19, 4) + "-" + val.substr(23, 2) + "-" + val.substr(25, 2));
  376. model.makeValue(tPath + "[4]/itm" + idx, "종료일");
  377. model.makeValue(tPath + "[4]/val" + idx, val.substr(27, 4) + "-" + val.substr(31, 2) + "-" + val.substr(33, 2));
  378. model.makeValue(tPath + "[5]/itm" + idx, "상병기호");
  379. model.makeValue(tPath + "[5]/val" + idx, val.substr(35, 10));
  380. model.makeValue(tPath + "[6]/itm" + idx, "일련번호");
  381. model.makeValue(tPath + "[6]/val" + idx, val.substr(45, 2));
  382. model.makeValue(tPath + "[7]/itm" + idx, "등록구분");
  383. var eVal = "";
  384. switch (val.substr(47, 1)) {
  385. case "1": eVal = "신규"; break;
  386. case "2": eVal = "재등록"; break;
  387. case "3": eVal = "중복암"; break;
  388. case "4": eVal = "중복암재등록"; break;
  389. default: break;
  390. }
  391. model.makeValue(tPath + "[7]/val" + idx, eVal);
  392. }
  393. // 산정특례(중복암)등록대상자5
  394. val = model.getValue(mPath + "disregprson16");
  395. if (val != "") {
  396. idx++;
  397. cap += "산정특례(중복암) 5^산정특례(중복암) 5^";
  398. model.makeValue(tPath + "[1]/itm" + idx, "특정기호");
  399. model.makeValue(tPath + "[1]/val" + idx, val.substr(0, 4));
  400. model.makeValue(tPath + "[2]/itm" + idx, "등록번호");
  401. model.makeValue(tPath + "[2]/val" + idx, val.substr(4, 15));
  402. model.makeValue(tPath + "[3]/itm" + idx, "등록일");
  403. model.makeValue(tPath + "[3]/val" + idx, val.substr(19, 4) + "-" + val.substr(23, 2) + "-" + val.substr(25, 2));
  404. model.makeValue(tPath + "[4]/itm" + idx, "종료일");
  405. model.makeValue(tPath + "[4]/val" + idx, val.substr(27, 4) + "-" + val.substr(31, 2) + "-" + val.substr(33, 2));
  406. model.makeValue(tPath + "[5]/itm" + idx, "상병기호");
  407. model.makeValue(tPath + "[5]/val" + idx, val.substr(35, 10));
  408. model.makeValue(tPath + "[6]/itm" + idx, "일련번호");
  409. model.makeValue(tPath + "[6]/val" + idx, val.substr(45, 2));
  410. model.makeValue(tPath + "[7]/itm" + idx, "등록구분");
  411. var eVal = "";
  412. switch (val.substr(47, 1)) {
  413. case "1": eVal = "신규"; break;
  414. case "2": eVal = "재등록"; break;
  415. case "3": eVal = "중복암"; break;
  416. case "4": eVal = "중복암재등록"; break;
  417. default: break;
  418. }
  419. model.makeValue(tPath + "[7]/val" + idx, eVal);
  420. }
  421. // 산정특례(중증치매) 등록대상자
  422. val = model.getValue(mPath + "disregprson17");
  423. if (val != "") {
  424. idx++;
  425. cap += "산정특례(중증치매)^산정특례(중증치매)^";
  426. model.makeValue(tPath + "[1]/itm" + idx, "특정기호");
  427. model.makeValue(tPath + "[1]/val" + idx, val.substr(0, 4));
  428. model.makeValue(tPath + "[2]/itm" + idx, "상병코드");
  429. model.makeValue(tPath + "[2]/val" + idx, val.substr(4, 10));
  430. model.makeValue(tPath + "[3]/itm" + idx, "일련번호");
  431. model.makeValue(tPath + "[3]/val" + idx, val.substr(14, 2));
  432. model.makeValue(tPath + "[4]/itm" + idx, "등록번호");
  433. model.makeValue(tPath + "[4]/val" + idx, val.substr(16, 15));
  434. model.makeValue(tPath + "[5]/itm" + idx, "시작일");
  435. model.makeValue(tPath + "[5]/val" + idx, val.substr(31, 4) + "-" + val.substr(35, 2) + "-" + val.substr(37, 2));
  436. model.makeValue(tPath + "[6]/itm" + idx, "상실일");
  437. model.makeValue(tPath + "[6]/val" + idx, val.substr(39, 4) + "-" + val.substr(43, 2) + "-" + val.substr(45, 2));
  438. model.makeValue(tPath + "[7]/itm" + idx, "차수시작일");
  439. model.makeValue(tPath + "[7]/val" + idx, val.substr(47, 4) + "-" + val.substr(51, 2) + "-" + val.substr(53, 2));
  440. model.makeValue(tPath + "[8]/itm" + idx, "차수종료일");
  441. model.makeValue(tPath + "[8]/val" + idx, val.substr(55, 4) + "-" + val.substr(59, 2) + "-" + val.substr(61, 2));
  442. model.makeValue(tPath + "[9]/itm" + idx, "연장전승인일수");
  443. model.makeValue(tPath + "[9]/val" + idx, val.substr(63, 3));
  444. model.makeValue(tPath + "[10]/itm" + idx, "연장후승인일수");
  445. model.makeValue(tPath + "[10]/val" + idx, val.substr(66, 3));
  446. }
  447. model.resetInstanceNode(gPath);
  448. grd_m2.refresh();
  449. var cols = grd_m2.cols;
  450. for (var i = 0; i < cols; i++) {
  451. grd_m2.removeColumn(false);
  452. }
  453. grd_m2.refresh();
  454. cnt = instance1.selectNodes(tPath).length;
  455. for (var i = 1; i <= idx; i++) {
  456. grd_m2.addColumn("ref:itm" + i + "; padding-left:1", false);
  457. grd_m2.addColumn("ref:val" + i + "; padding-left:1", false);
  458. var itmMax = 0;
  459. var valMax = 0;
  460. for (var j = 1; j <= cnt; j++) {
  461. var str = model.getValue(tPath + "[" + j + "]/itm" + i);
  462. if (str.length > itmMax) {
  463. itmMax = str.length;
  464. }
  465. str = model.getValue(tPath + "[" + j + "]/val" + i);
  466. if (str.length > valMax) {
  467. valMax = str.length;
  468. }
  469. }
  470. grd_m2.colWidth((i - 1) * 2) = Math.ceil(itmMax * 2 * 7.5 / 10) * 10;
  471. grd_m2.colWidth((i - 1) * 2 + 1) = Math.ceil(valMax * 7.5 / 10) * 10;
  472. }
  473. grd_m2.caption = cap.substr(0, cap.length - 1);
  474. model.copyNode("/root/grd/m2list", "/root/hidden/m2list");
  475. grd_m2.refresh();
  476. model.removeNode("/root/hidden/m2list");
  477. for (var i = 1; i < grd_m2.rows; i++) {
  478. for (var j = 1; j <= idx; j++) {
  479. if (model.getValue(gPath + "[" + i + "]/" + "val" + j) != "") {
  480. grd_m2.cellStyle("background-color", i, (j - 1) * 2) = "#cce8ff"
  481. }
  482. }
  483. }
  484. // 상병 정보가 하나도 없는 경우
  485. if (idx < 1) {
  486. grd_m2.addColumn("ref:desc; padding-left:2;", false);
  487. grd_m2.colWidth(0) = grd_m2.attribute("width").replace(/px/gi, "") - 2;
  488. grd_m2.caption = "";
  489. model.makeValue(gPath + "/desc", "등록된 상병 정보가 없습니다.");
  490. grd_m2.refresh();
  491. }
  492. }
  493. // 받아온 명칭과 저장 명칭이 다른 항목 설정
  494. model.makeValue("/root/temp/nhicrslt/m2/rrgstno", model.getValue("/root/temp/nhicrslt/m2/sujinjajuminno")); // 수진자 주민 등록번호
  495. model.makeValue("/root/temp/nhicrslt/m2/hngnm", model.getValue("/root/temp/nhicrslt/m2/sujinjajuminnm")); // 수진자 성명
  496. model.makeValue("/root/temp/nhicrslt/m2/proccorpcd", model.getValue("/root/temp/nhicrslt/m2/ykiho")); // 의료 급여 기관기호
  497. model.makeValue("/root/temp/nhicrslt/m2/qualflag", model.getValue("/root/temp/nhicrslt/m2/qlftype")); // 자격여부
  498. model.makeValue("/root/temp/nhicrslt/m2/qualacqtdd", model.getValue("/root/temp/nhicrslt/m2/qlfchwidukdt")); // 자격취득일
  499. model.makeValue("/root/temp/nhicrslt/m2/hshdnm", model.getValue("/root/temp/nhicrslt/m2/sedaejunm")); // 세대주 성명
  500. model.makeValue("/root/temp/nhicrslt/m2/secuinstmark", model.getValue("/root/temp/nhicrslt/m2/protadminsym")); // 보장기관기호(사업장기호)
  501. model.makeValue("/root/temp/nhicrslt/m2/estmmark", model.getValue("/root/temp/nhicrslt/m2/asylmsym")); // 시설기호(증번호)
  502. model.makeValue("/root/temp/nhicrslt/m2/paylimdd", model.getValue("/root/temp/nhicrslt/m2/payrestricdt")); // 급여제한일자(건강보험상실일자)
  503. model.makeValue("/root/temp/nhicrslt/m2/ownbflag", model.getValue("/root/temp/nhicrslt/m2/sbrdntype")); // 본인부담여부
  504. model.makeValue("/root/temp/nhicrslt/m2/heallifeamtval", model.getValue("/root/temp/nhicrslt/m2/cfhcrem")); // 건강생활유지비 잔액
  505. model.makeValue("/root/temp/nhicrslt/m2/choicorpmark1", model.getValue("/root/temp/nhicrslt/m2/ykiho1")); // 선택기관기호1(관할지사코드)
  506. model.makeValue("/root/temp/nhicrslt/m2/choicorpmark2", model.getValue("/root/temp/nhicrslt/m2/ykiho2")); // 선택기관기호2
  507. model.makeValue("/root/temp/nhicrslt/m2/choicorpmark3", model.getValue("/root/temp/nhicrslt/m2/ykiho3")); // 선택기관기호3
  508. model.makeValue("/root/temp/nhicrslt/m2/choicorpmark4", model.getValue("/root/temp/nhicrslt/m2/ykiho4")); // 선택기관기호4
  509. model.makeValue("/root/temp/nhicrslt/m2/choicorpnm1", model.getValue("/root/temp/nhicrslt/m2/yoyangnm1")); // 선택기관 이름1(관할지사명)
  510. model.makeValue("/root/temp/nhicrslt/m2/choicorpnm2", model.getValue("/root/temp/nhicrslt/m2/yoyangnm2")); // 선택기관 이름2
  511. model.makeValue("/root/temp/nhicrslt/m2/choicorpnm3", model.getValue("/root/temp/nhicrslt/m2/yoyangnm3")); // 선택기관 이름3
  512. model.makeValue("/root/temp/nhicrslt/m2/choicorpnm4", model.getValue("/root/temp/nhicrslt/m2/yoyangnm4")); // 선택기관 이름4
  513. model.makeValue("/root/temp/nhicrslt/m2/dcntrypsnyn", model.getValue("/root/temp/nhicrslt/m2/dprtyn")); // 출국자 여부
  514. model.makeValue("/root/temp/nhicrslt/m2/handicaprrgstdd", model.getValue("/root/temp/nhicrslt/m2/obstregdt")); // 장애인등록일자
  515. model.makeValue("/root/temp/nhicrslt/m2/rareobsttrgtman", model.getValue("/root/temp/nhicrslt/m2/disregprson1")); // 희귀난치대상자
  516. model.makeValue("/root/temp/nhicrslt/m2/befwomntrgtman", model.getValue("/root/temp/nhicrslt/m2/disregprson2")); // 산정특례(희귀)등록대상자
  517. model.makeValue("/root/temp/nhicrslt/m2/scndsuptrgtman", model.getValue("/root/temp/nhicrslt/m2/disregprson3")); // 차상위대상자
  518. model.makeValue("/root/temp/nhicrslt/m2/serdiagtrgtman", model.getValue("/root/temp/nhicrslt/m2/disregprson4")); // 산정특례(암)등록대상자
  519. model.makeValue("/root/temp/nhicrslt/m2/burntrgtman", model.getValue("/root/temp/nhicrslt/m2/disregprson5")); // 산정특례(화상)등록대상자
  520. model.makeValue("/root/temp/nhicrslt/m2/sugartrgtman", model.getValue("/root/temp/nhicrslt/m2/disregprson6")); // 제1형 당뇨병환자 대상자
  521. model.makeValue("/root/temp/nhicrslt/m2/procdurdd", model.getValue("/root/temp/nhicrslt/m2/disregprson7")); // 동일성분 의약품 제한자
  522. model.makeValue("/root/temp/nhicrslt/m2/paylimrgstdd", model.getValue("/root/temp/nhicrslt/m2/sangsilprocdt")); // 건강보험 수진자의 자격상실처리일자
  523. model.makeValue("/root/temp/nhicrslt/m2/selfcathcatheter", model.getValue("/root/temp/nhicrslt/m2/disregprson8")); // 자가도뇨 카테타 대상자
  524. model.makeValue("/root/temp/nhicrslt/m2/tbrcls", model.getValue("/root/temp/nhicrslt/m2/disregprson9")); // 산정특례(결핵)등록대상자
  525. model.makeValue("/root/temp/nhicrslt/m2/handicapyn", model.getValue("/root/temp/nhicrslt/m2/obstyn")); // 장애인등록여부(Y/N)
  526. model.makeValue("/root/temp/nhicrslt/m2/datainptdt", model.getValue("/root/temp/nhicrslt/m2/date")); // 데이터 입력 일자( 년월일-시분초)
  527. model.makeValue("/root/temp/nhicrslt/m2/msgcd" , model.getValue("/root/temp/nhicrslt/m2/messagecode")); // 서버로부터의 메시지 Code
  528. model.makeValue("/root/temp/nhicrslt/m2/msg", model.getValue("/root/temp/nhicrslt/m2/message")); // 서버로부터의 메시지
  529. model.makeValue("/root/temp/nhicrslt/m2/clntuniqval", model.getValue("/root/temp/nhicrslt/m2/clientinfo")); // 화면 클라이언트의 개별 고유 값
  530. // 산정특례(희귀)등록대상자
  531. // 특정기호(4) + 등록번호(15) + 등록일(8) + 종료일(8) + 상병코드(10) + 상병일련번호(2)
  532. // 특정기호 = V
  533. // 의료급여 희귀난치등록제 정보제공 11.1일
  534. // 상병코드,일련번호 2014.10.01.제공(건강보험)
  535. // 상병코드,일련번호 2014.12.01.제공(의료급여)
  536. var disRegPrson2 = model.getValue("/root/temp/nhicrslt/m2/disregprson2");
  537. if (disRegPrson2.trim() != "" && disRegPrson2.substr(0, 1) == "V") {
  538. model.makeValue("/root/temp/nhicrslt/m2/rooargstno", disRegPrson2.substr(4, 15));
  539. model.makeValue("/root/temp/nhicrslt/m2/rooafromdd", disRegPrson2.substr(19, 8));
  540. model.makeValue("/root/temp/nhicrslt/m2/rooatodd", disRegPrson2.substr(27, 8));
  541. }
  542. // 차상위대상자
  543. // 특정기호(4) + 시작일(8) + 종료일(8) + 구분(1)
  544. // [구분] '1':차상위1종, '2':차상위2종
  545. // 2008.04.01 1종 시행(C)
  546. // 2009.04.01 2종 시행(E, F)
  547. var disRegPrson3 = model.getValue("/root/temp/nhicrslt/m2/disregprson3");
  548. if (disRegPrson3.trim() != "" && disRegPrson3.length >= 21) {
  549. }
  550. // 산정특례(암)등록대상자
  551. // 특정기호(4) + 등록번호(15) + 등록일(8) + 종료일(8)
  552. // 2009. 12. 1일부 상병기호 제거
  553. // 의료급여 : 중증암 등록대상자
  554. var disRegPrson4 = model.getValue("/root/temp/nhicrslt/m2/disregprson4");
  555. if (disRegPrson4.trim() != "" && disRegPrson4.substr(0, 1) == "V") {
  556. model.makeValue("/root/temp/nhicrslt/m2/srdgrgstno", disRegPrson4.substr(4, 15));
  557. model.makeValue("/root/temp/nhicrslt/m2/srdgfromdd", disRegPrson4.substr(19, 8));
  558. model.makeValue("/root/temp/nhicrslt/m2/srdgtodd", disRegPrson4.substr(27, 8));
  559. }
  560. // 산정특례(화상)등록대상자
  561. // 특정기호(4) + 등록번호(15) + 등록일(8) + 종료일(8)
  562. // 특정기호 : V247-250
  563. // 2010.11.1 신규 (건강보험, 의료급여 제공)
  564. var disRegPrson5 = model.getValue("/root/temp/nhicrslt/m2/disregprson5");
  565. if (disRegPrson5.trim() != "" && disRegPrson5.substr(0, 1) == "V") {
  566. model.makeValue("/root/temp/nhicrslt/m2/burnrgstno", disRegPrson5.substr(4, 15));
  567. model.makeValue("/root/temp/nhicrslt/m2/burnfromdd", disRegPrson5.substr(19, 8));
  568. model.makeValue("/root/temp/nhicrslt/m2/burntodd", disRegPrson5.substr(27, 8));
  569. }
  570. // 산정특례(결핵)등록대상자
  571. // 특정기호(4) + 등록번호(15) + 등록일(8) + 종료일(8) + 상병코드(10) + 상병일련번호(2)
  572. // 특정기호 = V
  573. // 의료급여 희귀난치등록제 정보제공 11.1일
  574. // 상병코드,일련번호 2014.10.01.제공(건강보험만)
  575. var disRegPrson9 = model.getValue("/root/temp/nhicrslt/m2/disregprson9");
  576. if (disRegPrson9.trim() != "" && disRegPrson9.substr(0, 1) == "V") {
  577. model.makeValue("/root/temp/nhicrslt/m2/tbrclsrgstno", disRegPrson9.substr(4, 15));
  578. model.makeValue("/root/temp/nhicrslt/m2/tbrclsfromdd", disRegPrson9.substr(19, 8));
  579. model.makeValue("/root/temp/nhicrslt/m2/tbrclstodd", disRegPrson9.substr(27, 8));
  580. }
  581. // 산정특례(극희귀)등록대상자
  582. // 특정기호(4) + 등록번호(15) + 등록일(8) + 종료일(8) + 상병코드(10) + 상병일련번호(2)
  583. // 2016.4.1
  584. var disRegPrson10 = model.getValue("/root/temp/nhicrslt/m2/disregprson10");
  585. if (disRegPrson10.trim() != "" && disRegPrson10.substr(0, 1) == "V") {
  586. model.makeValue("/root/temp/nhicrslt/m2/drp10rgstno", disRegPrson10.substr(4, 15));
  587. model.makeValue("/root/temp/nhicrslt/m2/drp10fromdd", disRegPrson10.substr(19, 8));
  588. model.makeValue("/root/temp/nhicrslt/m2/drp10todd", disRegPrson10.substr(27, 8));
  589. }
  590. // 산정특례(상세불명희귀)등록대상자
  591. // 특정기호(4) + 등록번호(15) + 등록일(8) + 종료일(8) + 상병코드(10) + 상병일련번호(2)
  592. // 2016.4.1
  593. var disRegPrson11 = model.getValue("/root/temp/nhicrslt/m2/disregprson11");
  594. if (disRegPrson11.trim() != "" && disRegPrson11.substr(0, 1) == "V") {
  595. model.makeValue("/root/temp/nhicrslt/m2/drp11rgstno", disRegPrson11.substr(4, 15));
  596. model.makeValue("/root/temp/nhicrslt/m2/drp11fromdd", disRegPrson11.substr(19, 8));
  597. model.makeValue("/root/temp/nhicrslt/m2/drp11todd", disRegPrson11.substr(27, 8));
  598. }
  599. // 노인틀니 대상자(상악)
  600. // 등록번호(15) + 등록요양기관기호(8) + 틀니장착일(8) + 무상사후기간 종료일(8) + 시작일(8) + 종료일(8)
  601. // 2012.7.1 시행
  602. var dentTop = model.getValue("/root/temp/nhicrslt/m2/denttop");
  603. if (dentTop.trim() != "") {
  604. model.makeValue("/root/temp/nhicrslt/m2/denttopno", dentTop.substr(0, 15));
  605. model.makeValue("/root/temp/nhicrslt/m2/denttopkind", dentTop.substr(1, 1));
  606. model.makeValue("/root/temp/nhicrslt/m2/denttopproccorpcd", dentTop.substr(15, 8));
  607. model.makeValue("/root/temp/nhicrslt/m2/denttopfromdd", dentTop.substr(39, 8));
  608. // 종료일자가 없는 경우 시작일자 + 7년으로 설정
  609. if (!isValidDateTime(dentTop.substr(47, 8), "YYYYMMDD")) {
  610. model.makeValue("/root/temp/nhicrslt/m2/denttoptodd", dentTop.substr(39, 8).getAddDate(7, "Y"));
  611. } else {
  612. model.makeValue("/root/temp/nhicrslt/m2/denttoptodd", dentTop.substr(47, 8));
  613. }
  614. }
  615. // 노인틀니 대상자(하악)
  616. // 등록번호(15) + 등록요양기관기호(8) + 틀니장착일(8) + 무상사후기간 종료일(8) + 시작일(8) + 종료일(8)
  617. // 2012.7.1 시행
  618. var dentBottom = model.getValue("/root/temp/nhicrslt/m2/dentbottom");
  619. if (dentBottom.trim() != "") {
  620. model.makeValue("/root/temp/nhicrslt/m2/dentbottomno", dentBottom.substr(0, 15));
  621. model.makeValue("/root/temp/nhicrslt/m2/dentbottomkind", dentBottom.substr(1, 1));
  622. model.makeValue("/root/temp/nhicrslt/m2/dentbottomproccorpcd", dentBottom.substr(15, 8));
  623. model.makeValue("/root/temp/nhicrslt/m2/dentbottomfromdd", dentBottom.substr(39, 8));
  624. // 종료일자가 없는 경우 시작일자 + 7년으로 설정
  625. if (!isValidDateTime(dentBottom.substr(47, 8), 'YYYYMMDD')) {
  626. model.makeValue("/root/temp/nhicrslt/m2/dentbottomtodd", dentBottom.substr(39, 8).getAddDate(7, "Y"));
  627. } else {
  628. model.makeValue("/root/temp/nhicrslt/m2/dentbottomtodd", dentBottom.substr(47, 8));
  629. }
  630. }
  631. // 자격 여부
  632. var qlfType = model.getValue("/root/temp/nhicrslt/m2/qlftype");
  633. // 임플란트 대상자정보 1
  634. // 등록번호(18) + 등록요양기관기호(8) + 최종단계시술일(8) + 사후점검종료일(8) + 시작유효일(8) + 상실유효일(8)
  635. // 2014.7.1 시행
  636. var dentImpl1 = model.getValue("/root/temp/nhicrslt/m2/dentimpl1");
  637. if (dentImpl1.trim() != '') {
  638. model.makeValue("/root/temp/nhicrslt/m2/dentimpl1rgstno", dentImpl1.substr(0, 18));
  639. if (qlfType == "7" || qlfType == "8") { // 의료 급여
  640. model.makeValue("/root/temp/nhicrslt/m2/dentimpl1kind", dentImpl1.substr(3, 1));
  641. model.makeValue("/root/temp/nhicrslt/m2/dentimpl1proccorpcd", dentImpl1.substr(18, 8));
  642. } else { // 건강 보험
  643. model.makeValue("/root/temp/nhicrslt/m2/dentimpl1kind", dentImpl1.substr(8, 1));
  644. model.makeValue("/root/temp/nhicrslt/m2/dentimpl1proccorpcd", "");
  645. }
  646. model.makeValue("/root/temp/nhicrslt/m2/dentimpl1fromdd", dentImpl1.substr(42, 8));
  647. model.makeValue("/root/temp/nhicrslt/m2/dentimpl1todd", dentImpl1.substr(50, 8));
  648. }
  649. // 임플란트 대상자정보 2
  650. // 등록번호(18) + 등록요양기관기호(8) + 최종단계시술일(8) + 사후점검종료일(8) + 시작유효일(8) + 상실유효일(8)
  651. // 2014.7.1 시행
  652. var dentImpl2 = model.getValue("/root/temp/nhicrslt/m2/dentimpl2");
  653. if (dentImpl2.trim() != '') {
  654. model.makeValue("/root/temp/nhicrslt/m2/dentimpl2rgstno", dentImpl2.substr(0, 18));
  655. if (qlfType == "7" || qlfType == "8") { // 의료 급여
  656. model.makeValue("/root/temp/nhicrslt/m2/dentimpl2kind", dentImpl2.substr(3, 1));
  657. model.makeValue("/root/temp/nhicrslt/m2/dentimpl2proccorpcd", dentImpl2.substr(18, 8));
  658. } else { // 건강 보험
  659. model.makeValue("/root/temp/nhicrslt/m2/dentimpl2kind", dentImpl2.substr(8, 1));
  660. model.makeValue("/root/temp/nhicrslt/m2/dentimpl2proccorpcd", "");
  661. }
  662. model.makeValue("/root/temp/nhicrslt/m2/dentimpl2fromdd", dentImpl2.substr(42, 8));
  663. model.makeValue("/root/temp/nhicrslt/m2/dentimpl2todd", dentImpl2.substr(50, 8));
  664. }
  665. //조산아/저체중아 관련 (2017/01/31)
  666. //등록번호(10)+시작일자(8)+종료일자(8)
  667. var preinfant = model.getValue("/root/temp/nhicrslt/m2/preinfant");
  668. if (!isNull(preinfant)) {
  669. model.makeValue("/root/temp/nhicrslt/m2/preinfantfromdd", preinfant.substr(10, 8));
  670. model.makeValue("/root/temp/nhicrslt/m2/preinfanttodd", preinfant.substr(18, 8));
  671. model.makeValue("/root/temp/nhicrslt/m2/preinfantrgstno", preinfant.substr(0, 10));
  672. }
  673. //요양기관별 산정특례(결핵)등록대상자(2017/04/25)
  674. //특정기호(4)+산정특례등록번호(10)+치료시작일자(8)+치료종료일자(8)+의사면허번호(10)+의사성명(40)+종료요양기관기호(8)
  675. var disRegPrson12 = model.getValue("/root/temp/nhicrslt/m2/disregprson12");
  676. if (!isNull(disRegPrson12)) {
  677. model.makeValue("/root/temp/nhicrslt/m2/drp12fromdd", disRegPrson12.substr(14, 8));
  678. model.makeValue("/root/temp/nhicrslt/m2/drp12todd", disRegPrson12.substr(22, 8));
  679. model.makeValue("/root/temp/nhicrslt/m2/drp12rgstno", disRegPrson12.substr(4, 10));
  680. }
  681. // 자격 여부에 따른 저장 구분
  682. // 의료급여(7, 8)는 3개월, 건강보험은 3년 이내의 자료만 저장
  683. var saveFlag = true;
  684. if (( qlfType == "7" || qlfType == "8" ) && pDiagDt < getCurrentDate().toDate().getAddDate(-3, "M").getDateFormat("YYYYMMDD")) {
  685. saveFlag = false;
  686. if (pShowMsg) {
  687. messageBox("의료급여 자격자는 3개월 이전 자료 조회시 최종 자격이 표시되며,\n조회 내역이 저장되지 않습니다.", "E999");
  688. }
  689. } else if (pDiagDt < getCurrentDate().toDate().getAddDate(-3, "Y").getDateFormat("YYYYMMDD")) {
  690. saveFlag = false;
  691. if (pShowMsg) {
  692. messageBox("건강보험 자격자는 3년 이전 자료 조회시 최종 자격이 표시되며,\n조회 내역이 저장되지 않습니다.", "E999");
  693. }
  694. }
  695. if (saveFlag) {
  696. var m0CSV = "msgtype▦pid▦orddd▦cretno▦loginid▦password▦empno▦mpsissno▦reqdeptno▦deptcd▦ordtype▩"
  697. + "M1" + "▦"
  698. + pPid + "▦"
  699. + pDiagDt + "▦"
  700. + "" + "▦"
  701. + pLoginId + "▦"
  702. + pPassWord + "▦"
  703. + getUserId() + "▦"
  704. + "" + "▦"
  705. + "" + "▦"
  706. + "" + "▦"
  707. + "";
  708. model.makeValue("/root/main/m0temp", m0CSV);
  709. var m1CSV = "rrgstno▦proccorpcd▦orddd▦workdt▦hngnm▦loginid▦password▦datainptdt▦msgtype▦clntuniqval▦empno▦pgmtype▩"
  710. + pSujinjaJuminNo + "▦"
  711. + pYkiho + "▦"
  712. + pDiagDt + "▦"
  713. + "" + "▦"
  714. + pSujinjaJuminNm + "▦"
  715. + pLoginId + "▦"
  716. + pPassWord + "▦"
  717. + getCurrentDate() + "-" + getCurrentTime() + "▦"
  718. + "M1" + "▦"
  719. + pClientInfo + "▦"
  720. + getUserId() + "▦"
  721. + "3";
  722. model.makeValue("/root/main/m1temp", m1CSV);
  723. model.makeValue("/root/main/m2temp", getNodeListCSV(instance1.selectNodes("/root/temp/nhicrslt/m2")));
  724. submit("TXPAC03901", false);
  725. }
  726. return true;
  727. }
  728. function pmcfGetNhicQualification(pPid, pHngnm, pRgstno, pDate, pProcCorpCd, pLoginId, pPassWord) {
  729. // 1. M0, M1 생성
  730. // 2. 자격조회
  731. // 3. M2생성
  732. // 4. M2 return String 생성 및 return
  733. var sReturnValue = ""; // 헤더 + 값
  734. var sHeader = "rrgstno▦hngnm▦proccorpcd▦qualflag▦qualacqtdd▦hshdnm▦secuinstmark▦estmmark▦paylimdd▦ownbflag▦heallifeamtval▦pregremamt▦choicorpmark1▦choicorpmark2▦choicorpmark3▦choicorpmark4▦choicorpnm1▦choicorpnm2▦choicorpnm3▦choicorpnm4▦dcntrypsnyn▦datainptdt▦msgcd▦msg▦msgtype▦clntuniqval▦handicaprrgstdd▦disregprson1▦disregprson2▦disregprson3▦disregprson4▦handicapyn▦rareobsttrgtman▦befwomntrgtman▦scndsuptrgtman▦serdiagtrgtman▩"; // 리턴할
  735. // 헤더
  736. var sValue = ""; // 리턴할 값
  737. var sColSeperator = "▦";
  738. var sRowSeperator = "▩";
  739. // 모듈체크
  740. zehfCheckModule();
  741. // 1. M0, M1 생성
  742. var sM0_loginid = pLoginId;
  743. var sM0_password = pPassWord;
  744. var sM0_empno = "1234561234567";
  745. var sM1_rrgstno = pRgstno;
  746. var sM1_proccorpcd = pProcCorpCd;
  747. var sM1_hngnm = pHngnm;
  748. var sM1_orddd = pDate;
  749. var sM1_msgtype = "M1";
  750. var sM1_pgmtype = "2";
  751. var sM1_datainptdt = getCurrentDate() + "-" +getCurrentTime();
  752. var sM1_clntuniqval = getUserId();
  753. var url = "http://nhic.codns.com:1443/services/nhic?WSDL"; // url
  754. // M2
  755. var sM2_rrgstno = "";
  756. var sM2_hngnm = "";
  757. var sM2_proccorpcd = "";
  758. var sM2_qualflag = "";
  759. var sM2_qualacqtdd = "";
  760. var sM2_hshdnm = "";
  761. var sM2_secuinstmark = "";
  762. var sM2_estmmark = "";
  763. var sM2_paylimdd = "";
  764. var sM2_ownbflag = "";
  765. var sM2_heallifeamtval = "";
  766. var sM2_pregremamt = "";
  767. var sM2_choicorpmark1 = "";
  768. var sM2_choicorpmark2 = "";
  769. var sM2_choicorpmark3 = "";
  770. var sM2_choicorpmark4 = "";
  771. var sM2_choicorpnm1 = "";
  772. var sM2_choicorpnm2 = "";
  773. var sM2_choicorpnm3 = "";
  774. var sM2_choicorpnm4 = "";
  775. var sM2_handicaprrgstdd = "";
  776. var sM2_datainptdt = "";
  777. var sM2_dcntrypsnyn = "";
  778. var sM2_msgcd = "";
  779. var sM2_msg = "";
  780. var sM2_msgtype = "";
  781. var sM2_clntuniqval = "";
  782. var sM2_disregprson1 = "";
  783. var sM2_disregprson2 = "";
  784. var sM2_disregprson3 = "";
  785. var sM2_disregprson4 = "";
  786. var sM2_handicapyn = "";
  787. zehfAddParam("sujinjaJuminNo" , sM1_rrgstno); // 수진자 주민번호
  788. zehfAddParam("ykiho" , sM1_proccorpcd); // 의료급여 기관번호
  789. zehfAddParam("sujinjaJuminNm" , sM1_hngnm); // 수진자성명
  790. zehfAddParam("diagDt" , sM1_orddd); // 진료일자
  791. zehfAddParam("loginId" , sM0_loginid); // 공단포탈 로그인아이디
  792. zehfAddParam("password" , sM0_password); // 공단포탈 로그인패스워드
  793. zehfAddParam("date" , sM1_datainptdt); // 일자
  794. zehfAddParam("msgType" , sM1_msgtype); // 메시지 타입
  795. zehfAddParam("clientInfo" , sM1_clntuniqval); // 클라이언트 고유정보
  796. zehfAddParam("operatorJuminNo" , sM0_empno); // 조작자 주민번호
  797. zehfAddParam("pgmType" , sM1_pgmtype); // 프로그램 타입
  798. // 2. 자격조회
  799. var iCount = zehfQualify(url);
  800. // iCount <= 0
  801. if (iCount <= 0) {
  802. messageBox("정보 수신 실패", "E999", "");
  803. return;
  804. }
  805. // iCount == 1
  806. if (iCount == 1) {
  807. sM2_rrgstno = zehfGetValue(0, "sujinjaJuminNo");
  808. sM2_hngnm = zehfGetValue(0, "sujinjaJuminNm");
  809. sM2_proccorpcd = zehfGetValue(0, "ykiho");
  810. sM2_qualflag = zehfGetValue(0, "qlfType");
  811. sM2_qualacqtdd = zehfGetValue(0, "qlfChwidukDt");
  812. sM2_hshdnm = zehfGetValue(0, "sedaejuNm");
  813. sM2_secuinstmark = zehfGetValue(0, "protAdminSym");
  814. sM2_estmmark = zehfGetValue(0, "asylmSym");
  815. sM2_paylimdd = zehfGetValue(0, "payRestricDt");
  816. sM2_ownbflag = zehfGetValue(0, "sbrdnType");
  817. sM2_heallifeamtval = zehfGetValue(0, "cfhcRem");
  818. sM2_pregremamt = zehfGetValue(0, "pregRemAmt");
  819. sM2_choicorpmark1 = zehfGetValue(0, "ykiho1");
  820. sM2_choicorpmark2 = zehfGetValue(0, "ykiho2");
  821. sM2_choicorpmark3 = zehfGetValue(0, "ykiho3");
  822. sM2_choicorpmark4 = zehfGetValue(0, "ykiho4");
  823. sM2_choicorpnm1 = zehfGetValue(0, "yoyangNm1");
  824. sM2_choicorpnm2 = zehfGetValue(0, "yoyangNm2");
  825. sM2_choicorpnm3 = zehfGetValue(0, "yoyangNm3");
  826. sM2_choicorpnm4 = zehfGetValue(0, "yoyangNm4");
  827. sM2_handicaprrgstdd = zehfGetValue(0, "obstRegDt");
  828. sM2_datainptdt = zehfGetValue(0, "date");
  829. sM2_dcntrypsnyn = zehfGetValue(0, "dprtYn");
  830. sM2_msgcd = zehfGetValue(0, "messageCode");
  831. sM2_msg = zehfGetValue(0, "message");
  832. sM2_msgtype = zehfGetValue(0, "msgType");
  833. sM2_clntuniqval = zehfGetValue(0, "clientInfo");
  834. sM2_disregprson1 = zehfGetValue(0, "disRegPrson1"); //희귀난치대상자
  835. sM2_disregprson2 = zehfGetValue(0, "disRegPrson2"); //산전산모대상자
  836. sM2_disregprson3 = zehfGetValue(0, "disRegPrson3"); //차상위대상자
  837. sM2_disregprson4 = zehfGetValue(0, "disRegPrson4"); //중증암등록대상자
  838. sM2_handicapyn = zehfGetValue(0, "obstYn");
  839. sValue = sM2_rrgstno + sColSeperator +
  840. sM2_hngnm + sColSeperator +
  841. sM2_proccorpcd + sColSeperator +
  842. sM2_qualflag + sColSeperator +
  843. sM2_qualacqtdd + sColSeperator +
  844. sM2_hshdnm + sColSeperator +
  845. sM2_secuinstmark + sColSeperator +
  846. sM2_estmmark + sColSeperator +
  847. sM2_paylimdd + sColSeperator +
  848. sM2_ownbflag + sColSeperator +
  849. sM2_heallifeamtval + sColSeperator +
  850. sM2_pregremamt + sColSeperator +
  851. sM2_choicorpmark1 + sColSeperator +
  852. sM2_choicorpmark2 + sColSeperator +
  853. sM2_choicorpmark3 + sColSeperator +
  854. sM2_choicorpmark4 + sColSeperator +
  855. sM2_choicorpnm1 + sColSeperator +
  856. sM2_choicorpnm2 + sColSeperator +
  857. sM2_choicorpnm3 + sColSeperator +
  858. sM2_choicorpnm4 + sColSeperator +
  859. sM2_handicaprrgstdd + sColSeperator +
  860. sM2_datainptdt + sColSeperator +
  861. sM2_dcntrypsnyn + sColSeperator +
  862. sM2_msgcd + sColSeperator +
  863. sM2_msg + sColSeperator +
  864. sM2_msgtype + sColSeperator +
  865. sM2_clntuniqval + sColSeperator +
  866. sM2_disregprson1 + sColSeperator +
  867. sM2_disregprson2 + sColSeperator +
  868. sM2_disregprson3 + sColSeperator +
  869. sM2_disregprson4 + sColSeperator +
  870. sM2_handicapyn + sRowSeperator;
  871. sReturnValue = sHeader + sValue;
  872. }
  873. var sM0_header = "msgtype▦pid▦orddd▦cretno▦loginId▦password▦empno▦mpsissno▦reqdeptno▦deptcd▦ordtype▩";
  874. var sM0_value = sM1_msgtype + sColSeperator +
  875. pPid + sColSeperator +
  876. sM1_orddd + sColSeperator +
  877. "" + sColSeperator +
  878. sM0_loginid + sColSeperator +
  879. sM0_password + sColSeperator +
  880. sM0_empno + sColSeperator +
  881. "" + sColSeperator +
  882. "" + sColSeperator +
  883. "" + sColSeperator +
  884. "" + sRowSeperator;
  885. var sM1_header = "rrgstno▦hngnm▦proccorpcd▦orddd▦msgtype▦clntuniqval▦empno▦datainptdt▦pgmtype▦url▦pid▩";
  886. var sM1_value = sM1_rrgstno + sColSeperator +
  887. sM1_hngnm + sColSeperator +
  888. sM1_proccorpcd + sColSeperator +
  889. sM1_orddd + sColSeperator +
  890. sM1_msgtype + sColSeperator +
  891. sM1_clntuniqval + sColSeperator +
  892. sM0_empno + sColSeperator +
  893. sM1_datainptdt + sColSeperator +
  894. sM1_pgmtype + sColSeperator +
  895. url + sColSeperator +
  896. pPid + sRowSeperator;
  897. // 자격조회 정보 저장
  898. //<submission id="TXPAC03901" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/main/nhicinfo" resultref="/root/tmp"/>
  899. model.makeValue("/root/main/nhicinfo/m0temp", (sM0_header + sM0_value));
  900. model.makeValue("/root/main/nhicinfo/m1temp", (sM1_header + sM1_value));
  901. model.makeValue("/root/main/nhicinfo/m2temp", sReturnValue);
  902. if(submit("TXPAC03901")) {
  903. model.removeNode("/root/main/nhicinfo");
  904. }
  905. // 중증등록정보 마스터에 자동 입력
  906. // sM2_disregprson4 = "V1930108140327 2008092920130928D330 "; // 공단중증등록정보
  907. if( !isNull(sM2_disregprson4.trim()) && sM2_disregprson4.length == 40){
  908. //보험유형세팅
  909. if (sM2_qualflag == "7") { //의료급여1종
  910. model.makeValue("/root/send/srdginfo/insukind", "21");
  911. }
  912. else if (sM2_qualflag == "8") { //의료급여2종
  913. model.makeValue("/root/send/srdginfo/insukind", "22");
  914. }
  915. else { //건강보험
  916. model.makeValue("/root/send/srdginfo/insukind", "11");
  917. }
  918. model.removeNodeset("/root/send/srdginfo");
  919. model.makeNode("/root/send/srdginfo");
  920. model.makeValue("/root/send/srdginfo/rrgstno1", sM1_rrgstno.substr(0,6));
  921. model.makeValue("/root/send/srdginfo/rrgstno2", sM1_rrgstno.substr(6,7));
  922. model.makeValue("/root/send/srdginfo/serdiagno", sM2_disregprson4.substr(4,15).trim());
  923. model.makeValue("/root/send/srdginfo/serdiagfromdd", sM2_disregprson4.substr(19,8));
  924. model.makeValue("/root/send/srdginfo/serdiagtodd", sM2_disregprson4.substr(27,8));
  925. model.makeValue("/root/send/srdginfo/maindiagcd", sM2_disregprson4.substr(35,5));
  926. if(!isValidDateTime(model.getValue("/root/send/srdginfo/todd"), 'YYYYMMDD') ){
  927. model.makeValue("/root/send/srdginfo/todd", '99991231');
  928. }
  929. if(submit("TXPAC03903")){
  930. }
  931. model.removeNodeset("/root/send/srdginfo");
  932. }
  933. // 2009.03.25 - 테스트데이터...반영 시 제거..
  934. //sM2_disregprson3 = "F 20080401 2";
  935. var sHandyCapMsgYN = "N";
  936. // 2009.03.25 - 차상위대상자일 경우 차상위마스터에 데이터 입력
  937. if( !isNull(sM2_disregprson3.trim()) && sM2_disregprson3.length == 21){
  938. model.removeNodeset("/root/send/scndsuptrgtman");
  939. model.makeNode("/root/send/scndsuptrgtman");
  940. model.makeValue("/root/send/scndsuptrgtman/rrgstno1", sM1_rrgstno.substr(0,6));
  941. model.makeValue("/root/send/scndsuptrgtman/rrgstno2", sM1_rrgstno.substr(6,7));
  942. model.makeValue("/root/send/scndsuptrgtman/fromdd", sM2_disregprson3.substr(4,8));
  943. model.makeValue("/root/send/scndsuptrgtman/todd", sM2_disregprson3.substr(12,8));
  944. model.makeValue("/root/send/scndsuptrgtman/scndflag", sM2_disregprson3.substr(20,1));
  945. model.makeValue("/root/send/scndsuptrgtman/splccd", sM2_disregprson3.substr(0,4).trim());
  946. if(!isValidDateTime(model.getValue("/root/send/scndsuptrgtman/todd"), 'YYYYMMDD')){
  947. model.makeValue("/root/send/scndsuptrgtman/todd", '99991231');
  948. }
  949. // 차상위2종 장애인 일 때 메시지 출력
  950. if (sM2_disregprson3.substr(0,1).trim() == "F") {
  951. sHandyCapMsgYN = "Y";
  952. messageBox("차상위2종 장애인 대상 환자입니다. 장애인 마스터 등록여부를 확인해주세요!", "I");
  953. }
  954. if(submit("TXPAC03904")){
  955. }
  956. model.removeNodeset("/root/send/scndsuptrgtman");
  957. }
  958. if (sM2_handicaprrgstdd.trim() != "" && sHandyCapMsgYN != "Y") {
  959. messageBox("장애인으로 등록된 환자입니다. 장애인 마스터 등록여부를 확인해주세요!", "I");
  960. }
  961. // iCount > 1 결과가 2건 이상일 때 메시지 처리 - 재원변경관리 화면에서 처리하도록 유도
  962. if (iCount > 1) {
  963. messageBox("공단조회결과가 [" + iCount + "]건입니다.\n자격조회화면에서 자격확인 하십시오!", "I");
  964. }
  965. // 조회된 M2설정
  966. // 메모리 Clear
  967. zehfClose();
  968. return sReturnValue;
  969. }
  970. /* 중증등록정보 자동 저장
  971. *
  972. * 전제조건 : TXMRD00901 submission이 추가되어야 한다.
  973. * Parameter : pPid - 환자번호
  974. * pIOFlag - 입원외래구분
  975. * pInsuKind - 보험유형
  976. * pDisRegPrson4 - 공단자격 중증정보
  977. * pPtbsPath - 환자기본정보 xpath (ex. "/root/main/ptbs")
  978. * pSendPath - send xpath (ex. "/root/send/data999") 노드명 형태 - ptbs_pid
  979. * pSrdgPath - srdg xpath (ex. "/root/main/srdg")
  980. * Return : true/false
  981. */
  982. function pmcfSetSerDiagInfo(pPid, pIOFlag, pInsuKind, pDisRegPrson4, pPtbsPath, pSendPath, pSrdtPath) {
  983. var bResult = false;
  984. var sPtbsXPath = pPtbsPath;
  985. var sSendXPath = pSendPath;
  986. var sSrdgXPath = pSrdtPath;
  987. var sDisRegPrson4 = pDisRegPrson4;
  988. if (isNull(pPid)) {
  989. //messageBox("환자번호가 없습니다!!", "I");
  990. return false;
  991. }
  992. if (sPtbsXPath == null) {
  993. //messageBox("Ptbs XPath is null!!", "I");
  994. return false;
  995. }
  996. if (sSendXPath == null) {
  997. //messageBox("Send XPath is null!!", "I");
  998. return false;
  999. }
  1000. if (sSrdgXPath == null) {
  1001. //messageBox("Srdg XPath is null!!", "I");
  1002. return false;
  1003. }
  1004. if (isNull(sDisRegPrson4)) {
  1005. //messageBox("중증정보 is null!!", "I");
  1006. return false;
  1007. }
  1008. if (pInsuKind != "11" && pInsuKind != "21" && pInsuKind != "22") {
  1009. //messageBox("보험유형이 [건강보험][의료급여1종][의료급여2종]일 때만 적용됩니다[중증등록정보]!!", "I");
  1010. return false;
  1011. }
  1012. // 중증등록정보 분리 로직
  1013. var sSerDiagNo = null;
  1014. var sSerDiagFromdd = null;
  1015. var sSerDiagTodd = null;
  1016. if (pInsuKind == "11" || pInsuKind == "21" || pInsuKind == "22") {
  1017. // 중증등록번호 추출
  1018. if (pInsuKind == "11") { // 건강보험 (10자리)
  1019. sSerDiagNo = sDisRegPrson4.substring(4, 14);
  1020. }
  1021. if (pInsuKind == "21" || pInsuKind == "22") { // 의료급여 (15자리)
  1022. sSerDiagNo = sDisRegPrson4.substring(4, 19);
  1023. }
  1024. sSerDiagFromdd = sDisRegPrson4.substring(19, 27); // 중증등록시작일자
  1025. sSerDiagTodd = sDisRegPrson4.substring(27, 35); // 중증등록종료일자
  1026. //alert("sSerDiagNo: " + sSerDiagNo + "\n" + "sSerDiagFromdd: " + sSerDiagFromdd + "\n" + "sSerDiagTodd: " + sSerDiagTodd);
  1027. // 화면에 중증정보 설정
  1028. model.makeValue(sSrdgXPath + "/srdg_pid", pPid);
  1029. model.makeValue(sSrdgXPath + "/srdg_insukind", pInsuKind);
  1030. model.makeValue(sSrdgXPath + "/srdg_seridiagno", sSerDiagNo);
  1031. model.makeValue(sSrdgXPath + "/srdg_fromdd", sSerDiagFromdd);
  1032. model.makeValue(sSrdgXPath + "/srdg_todd", sSerDiagTodd);
  1033. model.removeNode(sSendXPath);
  1034. model.makeNode(sSendXPath);
  1035. model.makeValue(sSendXPath + "/flag1", "N");
  1036. model.makeValue(sSendXPath + "/flag2", "N");
  1037. model.makeValue(sSendXPath + "/status", "I");
  1038. model.makeValue(sSendXPath + "/genrdd", "");
  1039. model.makeValue(sSendXPath + "/genrno", "");
  1040. model.makeValue(sSendXPath + "/histno", "");
  1041. model.makeValue(sSendXPath + "/instcd", "");
  1042. model.makeValue(sSendXPath + "/histcd", "");
  1043. model.makeValue(sSendXPath + "/anohosprgstflag", "Y");
  1044. model.makeValue(sSendXPath + "/genrflagcd", pIOFlag);
  1045. model.makeValue(sSendXPath + "/pid", pPid);
  1046. model.makeValue(sSendXPath + "/insukind", pInsuKind);
  1047. model.makeValue(sSendXPath + "/cncrdiagcnfmdd", "");
  1048. model.makeValue(sSendXPath + "/orddeptcd", "-");
  1049. model.makeValue(sSendXPath + "/orddrid", "-");
  1050. model.makeValue(sSendXPath + "/serdiagno", sSerDiagNo);
  1051. model.makeValue(sSendXPath + "/serdiagfromdd", sSerDiagFromdd);
  1052. model.makeValue(sSendXPath + "/serdiagtodd", sSerDiagTodd);
  1053. model.makeValue(sSendXPath + "/genrorddd", "-");
  1054. model.makeValue(sSendXPath + "/genrcretno", 0);
  1055. model.makeValue(sSendXPath + "/ediflag", "N");
  1056. model.makeValue(sSendXPath + "/editretdd", "00000000");
  1057. model.makeValue(sSendXPath + "/editrettm", "000000");
  1058. model.makeValue(sSendXPath + "/maindiagcd", "");
  1059. model.makeValue(sSendXPath + "/rcptremfact", "");
  1060. model.makeValue(sSendXPath + "/zipcdhead", model.getValue(sPtbsXPath + "/ptbs_zipcd1"));
  1061. model.makeValue(sSendXPath + "/zipcdfoot", model.getValue(sPtbsXPath + "/ptbs_zipcd2"));
  1062. model.makeValue(sSendXPath + "/seqno", model.getValue(sPtbsXPath + "/ptbs_zipcdseq"));
  1063. model.makeValue(sSendXPath + "/infromdd", "00000000");
  1064. model.makeValue(sSendXPath + "/intodd", "000000");
  1065. model.makeValue(sSendXPath + "/acptplcebaseaddr", model.getValue(sPtbsXPath + "/ptbs_zipcdaddr"));
  1066. model.makeValue(sSendXPath + "/acptplceaddr", model.getValue(sPtbsXPath + "/ptbs_detladdr"));
  1067. model.makeValue(sSendXPath + "/acptplcetel", model.getValue(sPtbsXPath + "/ptbs_hometel"));
  1068. model.makeValue(sSendXPath + "/acptplcempphon", model.getValue(sPtbsXPath + "/ptbs_mpphontel"));
  1069. model.makeValue(sSendXPath + "/hngnm", model.getValue(sPtbsXPath + "/ptbs_hngnm"));
  1070. model.makeValue(sSendXPath + "/sex", model.getValue(sPtbsXPath + "/ptbs_sex"));
  1071. model.makeValue(sSendXPath + "/brthdd", model.getValue(sPtbsXPath + "/ptbs_brthdd"));
  1072. model.makeValue(sSendXPath + "/addr", (model.getValue(sPtbsXPath + "/ptbs_zipcdaddr") + " " + model.getValue(sPtbsXPath + "/ptbs_detladdr")));
  1073. model.makeValue(sSendXPath + "/roomcd", "");
  1074. model.makeValue(sSendXPath + "/remfact", "");
  1075. model.makeValue(sSendXPath + "/ioflag", pIOFlag);
  1076. if (submit("TXMRD00901")) {
  1077. //model.removeNode(sSendXPath);
  1078. //model.makeNode(sSendXPath);
  1079. bResult = true;
  1080. } else {
  1081. bResult = false;
  1082. }
  1083. model.refresh();
  1084. }
  1085. return bResult;
  1086. }