DataParser.java 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072
  1. package com.dbs.mplus.fatima.httpTask;
  2. import android.content.Context;
  3. import android.util.Log;
  4. import com.dbs.mplus.fatima.model.CategoryVO;
  5. import com.dbs.mplus.fatima.model.ConsentImageListVO;
  6. import com.dbs.mplus.fatima.model.ConsentListVO;
  7. import com.dbs.mplus.fatima.model.ConsentSetListVO;
  8. import com.dbs.mplus.fatima.model.ConsentWriteListVO;
  9. import com.dbs.mplus.fatima.model.DeptListVO;
  10. import com.dbs.mplus.fatima.model.DoctorListVO;
  11. import com.dbs.mplus.fatima.model.PatientInfoVO;
  12. import com.dbs.mplus.fatima.model.PatientListVO;
  13. import com.dbs.mplus.fatima.util.ConsentConfig;
  14. import com.dbs.mplus.fatima.util.Util;
  15. import org.json.JSONObject;
  16. import org.ksoap2.serialization.SoapObject;
  17. import java.util.ArrayList;
  18. import java.util.HashMap;
  19. public class DataParser {
  20. private static final String TAG = "DataParser";
  21. // public static DataParser instance;
  22. //
  23. // public static DataParser getInstance() {
  24. // if(instance == null) {
  25. // instance = new DataParser();
  26. // }
  27. // return instance;
  28. // }
  29. public static ArrayList<DeptListVO> getWardNDeptList(Context mContext, String result) {
  30. JSONObject object = Util.xmltoJsonObject(result);
  31. String res = Util.xmlToJsonString(object);
  32. ArrayList<HashMap<String, String>> rts = Util.parseJSON(mContext, res);
  33. ArrayList<HashMap<String, String>> arrayList = Util.parseJSON(mContext, rts.get(0).get("DeptListVO"));
  34. ArrayList<DeptListVO> deptListVOS = new ArrayList<DeptListVO>();
  35. for (int i = 0; i < arrayList.size(); i++) {
  36. HashMap<String, String> mm = arrayList.get(i);
  37. String deptCd = mm.get("deptcd").trim();
  38. String deptNm = mm.get("deptnm").trim();
  39. deptListVOS.add(new DeptListVO(deptCd, deptNm));
  40. }
  41. return deptListVOS;
  42. }
  43. public static ArrayList<DoctorListVO> getDoctorList(Context mContext, String result) {
  44. ArrayList<DoctorListVO> doctorListVOS = new ArrayList<DoctorListVO>();
  45. JSONObject object = Util.xmltoJsonObject(result);
  46. String res = Util.xmlToJsonString(object);
  47. ArrayList<HashMap<String, String>> rts1 = Util.parseJSON(mContext, res);
  48. ArrayList<HashMap<String, String>> rts2 = Util.parseJSON(mContext, rts1.get(0).get("DocListVO"));
  49. for (int i = 0; i < rts2.size(); i++) {
  50. HashMap<String, String> mm = rts2.get(i);
  51. String doctorId = mm.get("doctorid").trim();
  52. String doctorNm = mm.get("doctornm").trim();
  53. doctorListVOS.add(new DoctorListVO(doctorId, doctorNm));
  54. }
  55. return doctorListVOS;
  56. }
  57. public static ArrayList<PatientListVO> getPatientList(Context mContext, String result) {
  58. ArrayList<PatientListVO> arrayList = new ArrayList<PatientListVO>();
  59. JSONObject object = Util.xmltoJsonObject(result);
  60. String res = Util.xmlToJsonString(object);
  61. ArrayList<HashMap<String, String>> mapArrayList = Util.parseJSON(mContext, res);
  62. ArrayList<HashMap<String, String>> list = null;
  63. if (mapArrayList.size() == 0) {
  64. return arrayList;
  65. } else {
  66. if (mapArrayList.size() == 1) {
  67. HashMap<String, String> temp = mapArrayList.get(0);
  68. for (String key : temp.keySet()) {
  69. String data = temp.get(key);
  70. if (data.equals("")) {
  71. return arrayList;
  72. }
  73. }
  74. }
  75. }
  76. if (mapArrayList.get(0).get("PatListVO") == null) {
  77. list = mapArrayList;
  78. } else {
  79. list = Util.parseJSON(mContext, mapArrayList.get(0).get("PatListVO"));
  80. }
  81. if (list != null && list.size() > 0) {
  82. for (int i = 0; i < list.size(); i++) {
  83. HashMap<String, String> mm = list.get(i);
  84. String pid = "";
  85. String inDd = "";
  86. String cretNo = "";
  87. String seqNo = "";
  88. String instCd = "";
  89. String hngNm = "";
  90. String fSexAmFlag = "";
  91. String ordDeptCd = "";
  92. String doctorId = "";
  93. String hd = "";
  94. String sa = "";
  95. String deptNm = "";
  96. String deptEngAbbr = "";
  97. String doctorNm = "";
  98. String diagNm = "";
  99. String dschNoti = "";
  100. String roomCd = "";
  101. String cnst = "";
  102. String ordType = "";
  103. String boStyle = "";
  104. String elbulbodStat = "";
  105. String ordTm = "";
  106. String ordDrId = "";
  107. String ordDrNm = "";
  108. String ordDd = "";
  109. String opRoomNm = "";
  110. String astReqFlag = "";
  111. String anstDrNm = "";
  112. String erOrdDeptNm = "";
  113. String erMediSpclNm = "";
  114. String badCd = "";
  115. try {
  116. pid = mm.get("pid").trim();
  117. pid = Util.plusZero2("7", Integer.parseInt(pid));
  118. } catch (Exception e) {
  119. }
  120. try {
  121. inDd = mm.get("indd").trim();
  122. } catch (Exception e) {
  123. }
  124. try {
  125. cretNo = mm.get("cretno").trim();
  126. } catch (Exception e) {
  127. }
  128. try {
  129. seqNo = mm.get("seqno").trim();
  130. } catch (Exception e) {
  131. }
  132. try {
  133. instCd = mm.get("instcd").trim();
  134. } catch (Exception e) {
  135. }
  136. try {
  137. hngNm = mm.get("hngnm").trim();
  138. } catch (Exception e) {
  139. }
  140. try {
  141. fSexAmFlag = mm.get("fsexamflag").trim();
  142. } catch (Exception e) {
  143. }
  144. try {
  145. ordDeptCd = mm.get("orddeptcd").trim();
  146. } catch (Exception e) {
  147. }
  148. try {
  149. doctorId = mm.get("doctorid").trim();
  150. } catch (Exception e) {
  151. }
  152. try {
  153. hd = mm.get("hd").trim();
  154. } catch (Exception e) {
  155. }
  156. try {
  157. sa = mm.get("sa").trim();
  158. } catch (Exception e) {
  159. }
  160. try {
  161. deptNm = mm.get("deptnm").trim();
  162. } catch (Exception e) {
  163. }
  164. try {
  165. deptEngAbbr = mm.get("deptengabbr").trim();
  166. } catch (Exception e) {
  167. }
  168. try {
  169. doctorNm = mm.get("doctornm").trim();
  170. } catch (Exception e) {
  171. }
  172. try {
  173. diagNm = mm.get("diagnm").trim();
  174. } catch (Exception e) {
  175. }
  176. try {
  177. dschNoti = mm.get("dschnoti").trim();
  178. } catch (Exception e) {
  179. }
  180. try {
  181. roomCd = mm.get("roomcd").trim();
  182. } catch (Exception e) {
  183. }
  184. try {
  185. cnst = mm.get("cnst").trim();
  186. } catch (Exception e) {
  187. }
  188. try {
  189. ordType = mm.get("ordtype").trim();
  190. } catch (Exception e) {
  191. }
  192. try {
  193. boStyle = mm.get("bostyle").trim();
  194. } catch (Exception e) {
  195. }
  196. try {
  197. elbulbodStat = mm.get("elbulbodstat").trim();
  198. } catch (Exception e) {
  199. }
  200. try {
  201. ordTm = mm.get("ordtm").trim();
  202. } catch (Exception e) {
  203. }
  204. try {
  205. ordDrId = mm.get("orddrid").trim();
  206. } catch (Exception e) {
  207. }
  208. try {
  209. ordDrNm = mm.get("orddrnm").trim();
  210. } catch (Exception e) {
  211. }
  212. try {
  213. ordDd = mm.get("orddd").trim();
  214. } catch (Exception e) {
  215. }
  216. try {
  217. opRoomNm = mm.get("oproomnm").trim();
  218. opRoomNm = Util.plusZero2("2", Integer.parseInt(opRoomNm));
  219. } catch (Exception e) {
  220. }
  221. try {
  222. astReqFlag = mm.get("anstreqflag").trim();
  223. } catch (Exception e) {
  224. }
  225. try {
  226. anstDrNm = mm.get("anstdrnm").trim();
  227. } catch (Exception e) {
  228. }
  229. try {
  230. erOrdDeptNm = mm.get("erorddeptnm").trim();
  231. } catch (Exception e) {
  232. }
  233. try {
  234. erMediSpclNm = mm.get("ermedispclnm").trim();
  235. } catch (Exception e) {
  236. }
  237. String opCnfmDd = "";
  238. try {
  239. opCnfmDd = mm.get("opcnfmdd").trim();
  240. } catch (Exception e) {
  241. }
  242. try {
  243. badCd = mm.get("badcd").trim();
  244. } catch (Exception e) {
  245. }
  246. arrayList.add(new PatientListVO(pid, inDd, cretNo, seqNo, instCd, hngNm, fSexAmFlag, ordDeptCd, doctorId, hd, sa, deptNm, deptEngAbbr, doctorNm, diagNm, dschNoti, roomCd, cnst, ordType, boStyle, elbulbodStat, ordTm, ordDrId, ordDrNm, ordDd, opRoomNm, astReqFlag, anstDrNm, erOrdDeptNm, erMediSpclNm, opCnfmDd, badCd));
  247. }
  248. }
  249. return arrayList;
  250. }
  251. public static PatientInfoVO getPatientInfo(Context mContext, String result) {
  252. PatientInfoVO patientInfoVO = null;
  253. JSONObject object = Util.xmltoJsonObject(result);
  254. String res = Util.xmlToJsonString(object);
  255. ArrayList<HashMap<String, String>> arrayList = Util.parseJSON(mContext, res);
  256. String rts = arrayList.get(0).get("GetPatientInfoResult");
  257. if (rts != null && rts.equals("")) {
  258. } else {
  259. for (int i = 0; i < arrayList.size(); i++) {
  260. HashMap<String, String> mm = arrayList.get(i);
  261. String pid = "";
  262. String sa = "";
  263. String patientNm = "";
  264. String juminNo = "";
  265. String hosType = "";
  266. String ward = "";
  267. String roomNo = "";
  268. String adDate = "";
  269. String dschDd = "";
  270. String visitType = "";
  271. String deptCd = "";
  272. String deptHngNm = "";
  273. String deptEngNm = "";
  274. String opDeptCd = "";
  275. String opDeptNm = "";
  276. String opDrId = "";
  277. String opDrNm = "";
  278. String dxCd = "";
  279. String dxNm = "";
  280. String bp = "";
  281. String dm = "";
  282. String heart = "";
  283. String kidney = "";
  284. String respiration = "";
  285. String hx = "";
  286. String allergy = "";
  287. String drug = "";
  288. String smoking = "";
  289. String idio = "";
  290. String nacrotics = "";
  291. String airway = "";
  292. String hemorrhage = "";
  293. String statusEtc = "";
  294. String orderNo = "";
  295. String printTime = "";
  296. String mainDrId = "";
  297. String mainDrNm = "";
  298. String ocrCd = "";
  299. String inputId = "";
  300. String inputNm = "";
  301. String signImg = "";
  302. String cretNo = "";
  303. String zipCdAddr = "";
  304. String telNo = "";
  305. String insuKind = "";
  306. String erDrNm = "";
  307. try {
  308. pid = mm.get("IO_Pt_ID").trim();
  309. pid = Util.plusZero2("7", Integer.parseInt(pid));
  310. } catch (Exception e) {
  311. }
  312. try {
  313. sa = mm.get("IO_sex_age_y_m").trim();
  314. } catch (Exception e) {
  315. }
  316. try {
  317. patientNm = mm.get("IO_Pt_Name").trim();
  318. } catch (Exception e) {
  319. }
  320. try {
  321. juminNo = mm.get("IO_JuminNo").trim();
  322. } catch (Exception e) {
  323. }
  324. try {
  325. hosType = mm.get("IO_HosType").trim();
  326. } catch (Exception e) {
  327. }
  328. try {
  329. ward = mm.get("IO_Ward").trim();
  330. } catch (Exception e) {
  331. }
  332. try {
  333. roomNo = mm.get("IO_RoomNo").trim();
  334. } catch (Exception e) {
  335. }
  336. try {
  337. adDate = mm.get("IO_ADdate").trim();
  338. } catch (Exception e) {
  339. }
  340. try {
  341. dschDd = mm.get("IO_Dschdd").trim();
  342. } catch (Exception e) {
  343. }
  344. try {
  345. visitType = mm.get("IO_VisitType").trim();
  346. } catch (Exception e) {
  347. }
  348. try {
  349. deptCd = mm.get("IO_DeptCd").trim();
  350. } catch (Exception e) {
  351. }
  352. try {
  353. deptHngNm = mm.get("IO_DeptNm").trim();
  354. } catch (Exception e) {
  355. }
  356. try {
  357. deptEngNm = mm.get("IO_Dept2").trim();
  358. } catch (Exception e) {
  359. }
  360. try {
  361. opDeptCd = mm.get("IO_OPdeptCd").trim();
  362. } catch (Exception e) {
  363. }
  364. try {
  365. opDeptNm = mm.get("IO_OPdeptNm").trim();
  366. } catch (Exception e) {
  367. }
  368. try {
  369. opDrId = mm.get("IO_OPdrId").trim();
  370. } catch (Exception e) {
  371. }
  372. try {
  373. opDrNm = mm.get("IO_OPdrNm").trim();
  374. } catch (Exception e) {
  375. }
  376. try {
  377. dxCd = mm.get("IO_DxCd").trim();
  378. } catch (Exception e) {
  379. }
  380. try {
  381. dxNm = mm.get("IO_DxNm").trim();
  382. } catch (Exception e) {
  383. }
  384. try {
  385. bp = mm.get("IO_bp").trim();
  386. } catch (Exception e) {
  387. }
  388. try {
  389. dm = mm.get("IO_dm").trim();
  390. } catch (Exception e) {
  391. }
  392. try {
  393. heart = mm.get("IO_heart").trim();
  394. } catch (Exception e) {
  395. }
  396. try {
  397. kidney = mm.get("IO_kidney").trim();
  398. } catch (Exception e) {
  399. }
  400. try {
  401. respiration = mm.get("IO_respiration").trim();
  402. } catch (Exception e) {
  403. }
  404. try {
  405. hx = mm.get("IO_hx").trim();
  406. } catch (Exception e) {
  407. }
  408. try {
  409. allergy = mm.get("IO_allergy").trim();
  410. } catch (Exception e) {
  411. }
  412. try {
  413. drug = mm.get("IO_drug").trim();
  414. } catch (Exception e) {
  415. }
  416. try {
  417. smoking = mm.get("IO_smoking").trim();
  418. } catch (Exception e) {
  419. }
  420. try {
  421. idio = mm.get("IO_idio").trim();
  422. } catch (Exception e) {
  423. }
  424. try {
  425. nacrotics = mm.get("IO_nacrotics").trim();
  426. } catch (Exception e) {
  427. }
  428. try {
  429. airway = mm.get("IO_airway").trim();
  430. } catch (Exception e) {
  431. }
  432. try {
  433. hemorrhage = mm.get("IO_hemorrhage").trim();
  434. } catch (Exception e) {
  435. }
  436. try {
  437. statusEtc = mm.get("IO_status_etc").trim();
  438. } catch (Exception e) {
  439. }
  440. try {
  441. orderNo = mm.get("IO_OrderNo").trim();
  442. } catch (Exception e) {
  443. }
  444. try {
  445. printTime = mm.get("IO_PrintTime").trim();
  446. } catch (Exception e) {
  447. }
  448. try {
  449. mainDrId = mm.get("IO_MaindrId").trim();
  450. } catch (Exception e) {
  451. }
  452. try {
  453. mainDrNm = mm.get("IO_MaindrNm").trim();
  454. } catch (Exception e) {
  455. }
  456. try {
  457. ocrCd = mm.get("IO_OcrCd").trim();
  458. } catch (Exception e) {
  459. }
  460. try {
  461. inputId = mm.get("IO_InputId").trim();
  462. } catch (Exception e) {
  463. }
  464. try {
  465. inputNm = mm.get("IO_InputNm").trim();
  466. } catch (Exception e) {
  467. }
  468. try {
  469. signImg = mm.get("IO_SignImg").trim();
  470. } catch (Exception e) {
  471. }
  472. try {
  473. cretNo = mm.get("IO_CretNo").trim();
  474. } catch (Exception e) {
  475. }
  476. try {
  477. zipCdAddr = mm.get("IO_Zipcdaddr").trim();
  478. } catch (Exception e) {
  479. }
  480. try {
  481. telNo = mm.get("IO_Tel").trim();
  482. } catch (Exception e) {
  483. }
  484. try {
  485. insuKind = mm.get("IO_Insukind").trim();
  486. } catch (Exception e) {
  487. }
  488. try {
  489. erDrNm = mm.get("IO_ErdrNm").trim();
  490. } catch (Exception e) {
  491. }
  492. patientInfoVO = new PatientInfoVO();
  493. patientInfoVO.setPid(pid);
  494. patientInfoVO.setSa(sa);
  495. patientInfoVO.setPatientNm(patientNm);
  496. patientInfoVO.setJuminNo(juminNo);
  497. patientInfoVO.setHosType(hosType);
  498. patientInfoVO.setWard(ward);
  499. patientInfoVO.setRoomNo(roomNo);
  500. patientInfoVO.setAdDate(adDate);
  501. patientInfoVO.setDschDd(dschDd);
  502. patientInfoVO.setVisitType(visitType);
  503. patientInfoVO.setDeptCd(deptCd);
  504. patientInfoVO.setDeptHngNm(deptHngNm);
  505. patientInfoVO.setDeptEngNm(deptEngNm);
  506. patientInfoVO.setOpDeptCd(opDeptCd);
  507. patientInfoVO.setOpDeptNm(opDeptNm);
  508. patientInfoVO.setOpDrId(opDrId);
  509. patientInfoVO.setOpDrNm(opDrNm);
  510. patientInfoVO.setDxCd(dxCd);
  511. patientInfoVO.setDxNm(dxNm);
  512. patientInfoVO.setBp(bp);
  513. patientInfoVO.setDm(dm);
  514. patientInfoVO.setHeart(heart);
  515. patientInfoVO.setKidney(kidney);
  516. patientInfoVO.setRespiration(respiration);
  517. patientInfoVO.setHx(hx);
  518. patientInfoVO.setAllergy(allergy);
  519. patientInfoVO.setDrug(drug);
  520. patientInfoVO.setSmoking(smoking);
  521. patientInfoVO.setIdio(idio);
  522. patientInfoVO.setNacrotics(nacrotics);
  523. patientInfoVO.setAirway(airway);
  524. patientInfoVO.setHemorrhage(hemorrhage);
  525. patientInfoVO.setStatusEtc(statusEtc);
  526. patientInfoVO.setOrderNo(orderNo);
  527. patientInfoVO.setPrintTime(printTime);
  528. patientInfoVO.setMainDrId(mainDrId);
  529. patientInfoVO.setMainDrNm(mainDrNm);
  530. patientInfoVO.setOcrCd(ocrCd);
  531. patientInfoVO.setInputId(inputId);
  532. patientInfoVO.setInputNm(inputNm);
  533. patientInfoVO.setSignImg(signImg);
  534. patientInfoVO.setCretNo(cretNo);
  535. patientInfoVO.setZipCdAddr(zipCdAddr);
  536. patientInfoVO.setTelNo(telNo);
  537. patientInfoVO.setInsuKind(insuKind);
  538. patientInfoVO.setErDrNm(erDrNm);
  539. return patientInfoVO;
  540. }
  541. }
  542. return null;
  543. }
  544. public static ArrayList<ConsentListVO> getConsentList(Context mContext, String result) {
  545. ArrayList<ConsentListVO> arrayList = new ArrayList<ConsentListVO>();
  546. JSONObject object = Util.xmltoJsonObject(result);
  547. String res = Util.xmlToJsonString(object);
  548. ArrayList<HashMap<String, String>> mapArrayList = Util.parseJSON(mContext, res);
  549. String rts = "";
  550. ArrayList<HashMap<String, String>> list = null;
  551. if (mapArrayList.get(0).get("ConsentVO") == null) {
  552. rts = mapArrayList.get(0).get("GetConsentListResult");
  553. list = mapArrayList;
  554. } else {
  555. rts = mapArrayList.get(0).get("ConsentVO");
  556. list = Util.parseJSON(mContext, rts);
  557. }
  558. // rts = mapArrayList.get(0).get("GetConsentListResult");
  559. if (rts != null && rts.equals("")) {
  560. } else {
  561. for (int i = 0; i < list.size(); i++) {
  562. HashMap<String, String> mm = list.get(i);
  563. String consentMstRid = "";
  564. String consentStateDisp = "";
  565. String consentName = "";
  566. String hosType = "";
  567. String patientCode = "";
  568. String visitType = "";
  569. String orderNo = "";
  570. String orderCd = "";
  571. String orderNm = "";
  572. String clnDeptCd = "";
  573. String clnDeptNm = "";
  574. String ward = "";
  575. String roomCd = "";
  576. String formRid = "";
  577. String formCd = "";
  578. String formGuid = "";
  579. String prntCnt = "";
  580. String ocrNumber = "";
  581. String consentState = "";
  582. String cosignDcId = "";
  583. String cosignDcName = "";
  584. String createUserId = "";
  585. String createUserName = "";
  586. String createDateTime = "";
  587. String clnDate = "";
  588. String cretno = "";
  589. String ocrTagYN = "";
  590. try {
  591. consentMstRid = mm.get("ConsentMstRid").trim();
  592. } catch (Exception e) {
  593. }
  594. try {
  595. consentStateDisp = mm.get("ConsentStateDisp").trim();
  596. } catch (Exception e) {
  597. }
  598. try {
  599. consentName = mm.get("ConsentName").trim();
  600. } catch (Exception e) {
  601. }
  602. try {
  603. hosType = mm.get("HosType").trim();
  604. } catch (Exception e) {
  605. }
  606. try {
  607. patientCode = mm.get("PatientCode").trim();
  608. } catch (Exception e) {
  609. }
  610. try {
  611. visitType = mm.get("VisitType").trim();
  612. } catch (Exception e) {
  613. }
  614. try {
  615. orderNo = mm.get("orderNo").trim();
  616. } catch (Exception e) {
  617. }
  618. try {
  619. orderCd = mm.get("OrderCd").trim();
  620. } catch (Exception e) {
  621. }
  622. try {
  623. orderNm = mm.get("OrderNm").trim();
  624. } catch (Exception e) {
  625. }
  626. try {
  627. clnDeptCd = mm.get("ClnDeptCd").trim();
  628. } catch (Exception e) {
  629. }
  630. try {
  631. clnDeptNm = mm.get("ClnDeptNm").trim();
  632. } catch (Exception e) {
  633. }
  634. try {
  635. ward = mm.get("Ward").trim();
  636. } catch (Exception e) {
  637. }
  638. try {
  639. roomCd = mm.get("RoomCd").trim();
  640. } catch (Exception e) {
  641. }
  642. try {
  643. formRid = mm.get("FormRid").trim();
  644. } catch (Exception e) {
  645. }
  646. try {
  647. formCd = mm.get("FormCd").trim();
  648. } catch (Exception e) {
  649. }
  650. try {
  651. formGuid = mm.get("FormGuid").trim();
  652. } catch (Exception e) {
  653. }
  654. try {
  655. prntCnt = mm.get("PrntCnt").trim();
  656. } catch (Exception e) {
  657. }
  658. try {
  659. ocrNumber = mm.get("OcrNumber").trim();
  660. } catch (Exception e) {
  661. }
  662. try {
  663. consentState = mm.get("ConsentState").trim();
  664. } catch (Exception e) {
  665. }
  666. try {
  667. cosignDcId = mm.get("CosignDcId").trim();
  668. } catch (Exception e) {
  669. }
  670. try {
  671. cosignDcName = mm.get("CosignDcName").trim();
  672. } catch (Exception e) {
  673. }
  674. try {
  675. createUserId = mm.get("CreateUserId").trim();
  676. } catch (Exception e) {
  677. }
  678. try {
  679. createUserName = mm.get("CreateUserName").trim();
  680. } catch (Exception e) {
  681. }
  682. try {
  683. createDateTime = mm.get("CreateDateTime").trim();
  684. } catch (Exception e) {
  685. }
  686. try {
  687. clnDate = mm.get("ClnDate").trim();
  688. } catch (Exception e) {
  689. }
  690. try {
  691. cretno = mm.get("Cretno").trim();
  692. } catch (Exception e) {
  693. }
  694. try {
  695. ocrTagYN = mm.get("OcrTagYN").trim();
  696. } catch (Exception e) {
  697. }
  698. arrayList.add(new ConsentListVO(consentMstRid, consentStateDisp, consentName, hosType, patientCode, visitType, orderNo, orderCd, orderNm, clnDeptCd, clnDeptNm, ward, roomCd, formRid, formCd, formGuid, prntCnt, ocrNumber, consentState, cosignDcId, cosignDcName, createUserId, createUserName, createDateTime, clnDate, cretno, ocrTagYN));
  699. }
  700. }
  701. return arrayList;
  702. }
  703. public static ArrayList<ConsentSetListVO> getConsentSetList(Context mContext, String result, String apiType) {
  704. ArrayList<ConsentSetListVO> arrayList = new ArrayList<ConsentSetListVO>();
  705. JSONObject object = Util.xmltoJsonObject(result);
  706. String res = Util.xmlToJsonString(object);
  707. ArrayList<HashMap<String, String>> mapArrayList = Util.parseJSON(mContext, res);
  708. ArrayList<HashMap<String, String>> mapArrayList1 = null;
  709. if (mapArrayList.get(0).get("ConsentBySearchVO") != null) {
  710. mapArrayList1 = Util.parseJSON(mContext, mapArrayList.get(0).get("ConsentBySearchVO"));
  711. } else if (mapArrayList.get(0).get("ConsentSetVO") != null) {
  712. mapArrayList1 = Util.parseJSON(mContext, mapArrayList.get(0).get("ConsentSetVO"));
  713. } else if (mapArrayList.get(0).get("GetConsentSetListResult") != null) {
  714. } else if (mapArrayList.get(0).get("GetConsentBySearchResult") != null) {
  715. } else {
  716. mapArrayList1 = mapArrayList;
  717. }
  718. // for (String key : mapArrayList.get(0).keySet()) {
  719. // mapArrayList1 = Util.parseJSON(mContext, mapArrayList.get(0).get(key));
  720. // }
  721. if (mapArrayList1 == null) {
  722. } else {
  723. for (int i = 0; i < mapArrayList1.size(); i++) {
  724. HashMap<String, String> mm = mapArrayList1.get(i);
  725. String formRid = "";
  726. String formGuid = "";
  727. String formCd = "";
  728. String formName = "";
  729. String setAuth = "";
  730. String fullCategoryName = "";
  731. String prntCnt = "";
  732. String printOnly = "";
  733. String ocrTagYN = "";
  734. try {
  735. formRid = mm.get("FormRid").trim();
  736. } catch (Exception e) {
  737. }
  738. try {
  739. formGuid = mm.get("FormGuid").trim();
  740. } catch (Exception e) {
  741. }
  742. try {
  743. formCd = mm.get("FormCd").trim();
  744. } catch (Exception e) {
  745. }
  746. try {
  747. formName = mm.get("FormName").trim();
  748. } catch (Exception e) {
  749. }
  750. try {
  751. setAuth = mm.get("SetAuth").trim();
  752. } catch (Exception e) {
  753. }
  754. try {
  755. fullCategoryName = mm.get("FullCategoryName").trim();
  756. } catch (Exception e) {
  757. }
  758. try {
  759. prntCnt = mm.get("PrntCnt").trim();
  760. } catch (Exception e) {
  761. }
  762. try {
  763. printOnly = mm.get("PrintOnly").trim();
  764. } catch (Exception e) {
  765. }
  766. try {
  767. ocrTagYN = mm.get("OcrTagYN").trim();
  768. } catch (Exception e) {
  769. }
  770. arrayList.add(new ConsentSetListVO(formRid, formGuid, formCd, formName, setAuth, apiType.equals(ConsentConfig.GET_CONSENT_SET_LIST) ? "" : fullCategoryName, prntCnt, printOnly, ocrTagYN));
  771. }
  772. }
  773. return arrayList;
  774. }
  775. public static ArrayList<CategoryVO> getCategoryList(Context mContext, String result) {
  776. ArrayList<CategoryVO> arrayList = new ArrayList<CategoryVO>();
  777. JSONObject object = Util.xmltoJsonObject(result);
  778. String res = Util.xmlToJsonString(object);
  779. ArrayList<HashMap<String, String>> mapArrayList = Util.parseJSON(mContext, res);
  780. ArrayList<HashMap<String, String>> mapArrayList1 = null;
  781. for (String key : mapArrayList.get(0).keySet()) {
  782. mapArrayList1 = Util.parseJSON(mContext, mapArrayList.get(0).get(key));
  783. }
  784. if (mapArrayList1 == null && mapArrayList1.size() == 0) {
  785. } else {
  786. for (int i = 0; i < mapArrayList1.size(); i++) {
  787. HashMap<String, String> mm = mapArrayList1.get(i);
  788. String categoryType = "";
  789. String categoryId = "";
  790. String categoryName = "";
  791. try {
  792. categoryType = mm.get("CategoryType").trim();
  793. } catch (Exception e) {
  794. }
  795. try {
  796. categoryId = mm.get("CategoryId").trim();
  797. } catch (Exception e) {
  798. }
  799. try {
  800. categoryName = mm.get("CategoryName").trim();
  801. } catch (Exception e) {
  802. }
  803. arrayList.add(new CategoryVO(categoryType, categoryId, categoryName));
  804. }
  805. }
  806. return arrayList;
  807. }
  808. public static ArrayList<ConsentWriteListVO> getUnfinishedListPerDoctor(Context mContext, String result) {
  809. ArrayList<ConsentWriteListVO> arrayList = new ArrayList<ConsentWriteListVO>();
  810. JSONObject object = Util.xmltoJsonObject(result);
  811. String res = Util.xmlToJsonString(object);
  812. ArrayList<HashMap<String, String>> mapArrayList = Util.parseJSON(mContext, res);
  813. ArrayList<HashMap<String, String>> mapArrayList1 = null;
  814. if (mapArrayList.get(0).get("UnFinishedListVO") != null) {
  815. mapArrayList1 = Util.parseJSON(mContext, mapArrayList.get(0).get("UnFinishedListVO"));
  816. } else if (mapArrayList.get(0).get("GetUnfinishedListPerDoctorResult") != null) {
  817. } else {
  818. mapArrayList1 = mapArrayList;
  819. }
  820. // for (String key : mapArrayList.get(0).keySet()) {
  821. // mapArrayList1 = Util.parseJSON(mContext, mapArrayList.get(0).get(key));
  822. // }
  823. if (mapArrayList1 == null) {
  824. } else {
  825. for (int i = 0; i < mapArrayList1.size(); i++) {
  826. HashMap<String, String> mm = mapArrayList1.get(i);
  827. String pid = "";
  828. String formCd = "";
  829. String formNm = "";
  830. String hngNm = "";
  831. String orderDate = "";
  832. String printOnly = "";
  833. String certTarget = "";
  834. String consentState = "";
  835. String consentMstRid = "";
  836. String ordDd = "";
  837. String ordType = "";
  838. String ordDeptCd = "";
  839. String orderNo = "";
  840. String orderCd = "";
  841. String ocrNumber = "";
  842. String cretNo = "";
  843. String createUserName = "";
  844. String formRid = "";
  845. String formGuid = "";
  846. try {
  847. pid = mm.get("pid").trim();
  848. pid = Util.plusZero2("7", Integer.parseInt(pid));
  849. } catch(Exception e){
  850. }
  851. try {
  852. formCd = mm.get("formcd").trim();
  853. } catch(Exception e){
  854. }
  855. try {
  856. formNm = mm.get("formnm").trim();
  857. } catch (Exception e) {
  858. }
  859. try {
  860. hngNm = mm.get("hngnm").trim();
  861. } catch(Exception e){
  862. }
  863. try {
  864. orderDate = mm.get("orderdate").trim();
  865. } catch(Exception e){
  866. }
  867. try {
  868. printOnly = mm.get("printonly").trim();
  869. } catch(Exception e){
  870. }
  871. try {
  872. certTarget = mm.get("certtarget").trim();
  873. } catch(Exception e){
  874. }
  875. try {
  876. consentState = mm.get("consentstate").trim();
  877. } catch(Exception e){
  878. }
  879. try {
  880. consentMstRid = mm.get("consentmstrid").trim();
  881. } catch(Exception e){
  882. }
  883. try {
  884. ordDd = mm.get("orddd").trim();
  885. } catch(Exception e){
  886. }
  887. try {
  888. ordType = mm.get("ordtype").trim();
  889. } catch(Exception e){
  890. }
  891. try {
  892. ordDeptCd = mm.get("orddeptcd").trim();
  893. } catch(Exception e){
  894. }
  895. try {
  896. orderNo = mm.get("orderno").trim();
  897. } catch(Exception e){
  898. }
  899. try {
  900. orderCd = mm.get("ordercd").trim();
  901. } catch (Exception e) {
  902. }
  903. try {
  904. ocrNumber = mm.get("ocrnumber").trim();
  905. } catch(Exception e){
  906. }
  907. try {
  908. cretNo = mm.get("cretno").trim();
  909. } catch(Exception e){
  910. }
  911. try {
  912. createUserName = mm.get("createusername").trim();
  913. } catch(Exception e){
  914. }
  915. try {
  916. formRid = mm.get("formrid").trim();
  917. } catch(Exception e){
  918. }
  919. try {
  920. formGuid = mm.get("formguid").trim();
  921. } catch(Exception e){
  922. }
  923. arrayList.add(new ConsentWriteListVO(pid, formCd, formNm, hngNm, orderDate, printOnly, certTarget, consentState, consentMstRid, ordDd, ordType, ordDeptCd, orderNo, orderCd, ocrNumber, cretNo, createUserName, formRid, formGuid));
  924. }
  925. }
  926. return arrayList;
  927. }
  928. public static ArrayList<ConsentImageListVO> getConsetImageList(Context mContext, String result) {
  929. ArrayList<ConsentImageListVO> arrayList = new ArrayList<>();
  930. JSONObject object = Util.xmltoJsonObject(result);
  931. String res = Util.xmlToJsonString(object);
  932. Log.e(TAG, "res -- > " + res);
  933. ArrayList<HashMap<String, String>> mapArrayList = Util.parseJSON(mContext, res);
  934. if (mapArrayList.get(0).get("ConsentImageVO") != null) {
  935. mapArrayList = Util.parseJSON(mContext, mapArrayList.get(0).get("ConsentImageVO"));
  936. }
  937. if (mapArrayList == null && mapArrayList.size() == 0) {
  938. } else {
  939. for (int i = 0; i < mapArrayList.size(); i++) {
  940. HashMap<String, String> mm = mapArrayList.get(i);
  941. String _consentMstRid = "";
  942. String _consentImageRid = "";
  943. String _formRid = "";
  944. String _imagePath = "";
  945. String _imageFileName = "";
  946. String _completeYn = "";
  947. String _createUserId = "";
  948. String _createDateTime = "";
  949. try {
  950. _consentMstRid = mm.get("ConsentMstRid").trim();
  951. } catch (Exception e) {
  952. }
  953. try {
  954. _consentImageRid = mm.get("ConsentImageRid").trim();
  955. } catch (Exception e) {
  956. }
  957. try {
  958. _formRid = mm.get("FormRid").trim();
  959. } catch (Exception e) {
  960. }
  961. try {
  962. _imagePath = mm.get("ImagePath").trim();
  963. } catch (Exception e) {
  964. }
  965. try {
  966. _imageFileName = mm.get("ImageFilename").trim();
  967. } catch (Exception e) {
  968. }
  969. try {
  970. _completeYn = mm.get("CompleteYn").trim();
  971. } catch (Exception e) {
  972. }
  973. try {
  974. _createUserId = mm.get("CreateUserId").trim();
  975. } catch (Exception e) {
  976. }
  977. try {
  978. _createDateTime = mm.get("CreateDatetime").trim();
  979. } catch (Exception e) {
  980. }
  981. arrayList.add(new ConsentImageListVO(_consentMstRid, _consentImageRid, _formRid, _imagePath, _imageFileName, _completeYn, _createUserId, _createDateTime));
  982. }
  983. }
  984. return arrayList;
  985. }
  986. }