ParseJsonData.java 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. package com.dbs.dbsec.httpTask;
  2. import android.content.Context;
  3. import android.util.Log;
  4. import com.dbs.dbsec.R;
  5. import com.dbs.dbsec.model.CategoryVO;
  6. import com.dbs.dbsec.model.ConsentFormListVO;
  7. import com.dbs.dbsec.model.DeptListVO;
  8. import com.dbs.dbsec.model.DoctorListVO;
  9. import com.dbs.dbsec.model.PatientInfoVO;
  10. import com.dbs.dbsec.model.PatientListVO;
  11. import com.dbs.dbsec.model.UserLoginDeptList;
  12. import com.dbs.dbsec.util.Common;
  13. import java.lang.reflect.Array;
  14. import java.util.ArrayList;
  15. import java.util.HashMap;
  16. public class ParseJsonData {
  17. private static final String TAG = "ParseJsonData";
  18. private Context mContext;
  19. public static ParseJsonData instance;
  20. public ParseJsonData(Context mContext) {
  21. this.mContext = mContext;
  22. }
  23. public static ParseJsonData getInstance(Context mContext) {
  24. if (instance == null) {
  25. instance = new ParseJsonData(mContext);
  26. }
  27. return instance;
  28. }
  29. public ArrayList<UserLoginDeptList> userLoginDeptList(ArrayList<HashMap<String, String>> result) {
  30. String data = result.get(0).get("data");
  31. ArrayList<HashMap<String, String>> dataAr = Common.parseJSON(mContext, data);
  32. ArrayList<UserLoginDeptList> rts = new ArrayList<UserLoginDeptList>();
  33. for (int i = 0; i < dataAr.size(); i++) {
  34. HashMap<String, String> mm = dataAr.get(i);
  35. String dutplceInstCd = mm.get("dutplceInstCd");
  36. String dutplceInstNm = mm.get("dutplceInstNm");
  37. String userId = mm.get("userId");
  38. String userName = mm.get("userName");
  39. String jobKindCd = mm.get("jobKindCd");
  40. String jobKindNm = mm.get("jobKindNm");
  41. String drKind = mm.get("drKind");
  42. String deptCd = mm.get("deptCd");
  43. String deptHngNm = mm.get("deptHngNm");
  44. String dutplceCd = mm.get("dutplceCd");
  45. String indexPage = mm.get("indexPage");
  46. String sortNo = mm.get("sortNo");
  47. String fromDd = mm.get("fromDd");
  48. rts.add(new UserLoginDeptList(dutplceInstCd, dutplceInstNm, userId, userName, jobKindCd, jobKindNm, drKind, deptCd, deptHngNm, dutplceCd, indexPage, sortNo, fromDd));
  49. }
  50. return rts;
  51. }
  52. public ArrayList<DeptListVO> getWardNDeptList(ArrayList<HashMap<String, String>> result) {
  53. String data = result.get(0).get("data");
  54. ArrayList<HashMap<String, String>> rts = Common.parseJSON(mContext, data);
  55. ArrayList<DeptListVO> arrayList = new ArrayList<DeptListVO>();
  56. for (int i = 0; i < rts.size(); i++) {
  57. HashMap<String, String> mm = rts.get(i);
  58. String deptCd = mm.get("deptCd");
  59. String deptNm = mm.get("deptNm");
  60. arrayList.add(new DeptListVO(deptCd, deptNm));
  61. }
  62. return arrayList;
  63. }
  64. public ArrayList<DoctorListVO> getDoctorList(ArrayList<HashMap<String, String>> result) {
  65. String data = result.get(0).get("data");
  66. ArrayList<HashMap<String, String>> rts = Common.parseJSON(mContext, data);
  67. ArrayList<DoctorListVO> arrayList = new ArrayList<DoctorListVO>();
  68. for (int i = 0; i < rts.size(); i++) {
  69. HashMap<String, String> mm = rts.get(i);
  70. String doctorId = mm.get("doctorId");
  71. String doctorNm = mm.get("doctorNm");
  72. String doctorKind = mm.get("doctorKind");
  73. String drKind = mm.get("drKind");
  74. arrayList.add(new DoctorListVO(doctorId, doctorNm, doctorKind, drKind));
  75. }
  76. return arrayList;
  77. }
  78. public ArrayList<PatientListVO> getPatientList(ArrayList<HashMap<String, String>> result) {
  79. String data = result.get(0).get("data");
  80. ArrayList<HashMap<String, String>> rts = Common.parseJSON(mContext, data);
  81. ArrayList<PatientListVO> arrayList = new ArrayList<PatientListVO>();
  82. for (int i = 0; i < rts.size(); i++) {
  83. HashMap<String, String> mm = rts.get(i);
  84. String pid = mm.get("pid");
  85. String inDd = mm.get("inDd");
  86. String cretNo = mm.get("cretNo");
  87. String ordType = mm.get("ordType");
  88. String hngNm = mm.get("hngNm");
  89. String ordDeptCd = mm.get("ordDeptCd");
  90. String doctorId = mm.get("doctorId");
  91. String sexNAge = mm.get("sexNAge");
  92. String deptNm = mm.get("deptNm");
  93. String doctorNm = mm.get("doctorNm");
  94. String roomCd = mm.get("roomCd");
  95. String opRoomNm = mm.get("opRoomNm");
  96. String oprsrvNo = mm.get("oprsrvNo");
  97. arrayList.add(new PatientListVO(pid, inDd, cretNo, ordType, hngNm, ordDeptCd, doctorId, sexNAge, deptNm, doctorNm, roomCd, opRoomNm, oprsrvNo));
  98. }
  99. return arrayList;
  100. }
  101. public PatientInfoVO getPatientInfo(ArrayList<HashMap<String, String>> result) {
  102. String data = result.get(0).get("data");
  103. PatientInfoVO patientInfoVO = null;
  104. ArrayList<HashMap<String, String>> rts = Common.parseJSON(mContext, data);
  105. patientInfoVO = new PatientInfoVO();
  106. for (int i = 0; i < rts.size(); i++) {
  107. HashMap<String, String> mm = rts.get(i);
  108. String ordDeptCd = mm.get("ordDeptCd");
  109. String deptEngAbbr = mm.get("deptEngAbbr");
  110. String ordDeptNm = mm.get("ordDeptNm");
  111. String pid = mm.get("pid");
  112. String cretNo = mm.get("cretNo");
  113. String roomCd = mm.get("roomCd");
  114. String inDd = mm.get("inDd");
  115. String dschDd = mm.get("dschDd");
  116. String ordType = mm.get("ordType");
  117. String instCd = mm.get("instCd");
  118. String mainDrId = mm.get("mainDrId");
  119. String mainDrName = mm.get("mainDrName");
  120. String erDrNm = mm.get("erDrNm");
  121. String firstRgstDt = mm.get("firstRgstDt");
  122. String sa = mm.get("sa");
  123. String patientName = mm.get("patientName");
  124. String juminNo = mm.get("juminNo");
  125. String zipCdAddr = mm.get("zipCdAddr");
  126. String telNum = mm.get("telNum");
  127. String insuKind = mm.get("insuKind");
  128. String ward = mm.get("ward");
  129. String dxCd = mm.get("dxCd");
  130. String dxNm = mm.get("dxNm");
  131. String gb = mm.get("gb");
  132. String gbn = mm.get("gbn");
  133. String opDeptCd = mm.get("opDeptCd");
  134. String opDeptNm = mm.get("opDeptNm");
  135. String opDrNm = mm.get("opDrNm");
  136. String opDrId = mm.get("opDrId");
  137. String opCnfmDd = mm.get("opCnfmDd");
  138. String perfDrNm = mm.get("perfDrNm");
  139. String perfDrFlag = mm.get("perfDrFlag");
  140. String perfDrDept = mm.get("perfDrDept");
  141. String opDiagNm = mm.get("opDiagNm");
  142. String opNm = mm.get("opNm");
  143. String anstDrNm1 = mm.get("anstDrNm1");
  144. String anstDrFlag1 = mm.get("anstDrFlag1");
  145. String anstDeptNm1 = mm.get("anstDeptNm1");
  146. String anstDrNm2 = mm.get("anstDrNm2");
  147. String anstDrFlag2 = mm.get("anstDrFlag2");
  148. String anstDeptNm2 = mm.get("anstDeptNm2");
  149. String anstDrNm3 = mm.get("anstDrNm3");
  150. String anstDrFlag3 = mm.get("anstDrFlag3");
  151. String anstDeptNm3 = mm.get("anstDeptNm3");
  152. String opRsrvNo = mm.get("opRsrvNo");
  153. String orderNo = mm.get("orderNo");
  154. String printTime = mm.get("printTime");
  155. String ocrCd = mm.get("ocrCd");
  156. String inputId = mm.get("inputId");
  157. String inputNm = mm.get("inputNm");
  158. String signImg = mm.get("signImg");
  159. String bp = mm.get("bp");
  160. String dm = mm.get("dm");
  161. String heart = mm.get("heart");
  162. String kidney = mm.get("kidney");
  163. String respiration = mm.get("respiration");
  164. String hx = mm.get("hx");
  165. String allergy = mm.get("allergy");
  166. String drug = mm.get("drug");
  167. String smoking = mm.get("smoking");
  168. String idio = mm.get("idio");
  169. String nacrotics = mm.get("nacrotics");
  170. String airway = mm.get("airway");
  171. String hemorrhage = mm.get("hemorrhage");
  172. String statusEt = mm.get("statusEt");
  173. patientInfoVO.setOrdDeptCd(ordDeptCd);
  174. patientInfoVO.setDeptEngAbbr(deptEngAbbr);
  175. patientInfoVO.setOrdDeptNm(ordDeptNm);
  176. patientInfoVO.setPid(pid);
  177. patientInfoVO.setCretNo(cretNo);
  178. patientInfoVO.setRoomCd(roomCd);
  179. patientInfoVO.setInDd(inDd);
  180. patientInfoVO.setDschDd(dschDd);
  181. patientInfoVO.setOrdType(ordType);
  182. patientInfoVO.setInstCd(instCd);
  183. patientInfoVO.setMainDrId(mainDrId);
  184. patientInfoVO.setMainDrName(mainDrName);
  185. patientInfoVO.setErDrNm(erDrNm);
  186. patientInfoVO.setFirstRgstDt(firstRgstDt);
  187. patientInfoVO.setSa(sa);
  188. patientInfoVO.setPatientName(patientName);
  189. patientInfoVO.setJuminNo(juminNo);
  190. patientInfoVO.setZipCdAddr(zipCdAddr);
  191. patientInfoVO.setTelNum(telNum);
  192. patientInfoVO.setInsuKind(insuKind);
  193. patientInfoVO.setWard(ward);
  194. patientInfoVO.setDxCd(dxCd);
  195. patientInfoVO.setDxNm(dxNm);
  196. patientInfoVO.setGb(gb);
  197. patientInfoVO.setGbn(gbn);
  198. patientInfoVO.setOpDeptCd(opDeptCd);
  199. patientInfoVO.setOpDeptNm(opDeptNm);
  200. patientInfoVO.setOpDrNm(opDrNm);
  201. patientInfoVO.setOpDrId(opDrId);
  202. patientInfoVO.setOpCnfmDd(opCnfmDd);
  203. patientInfoVO.setPerfDrNm(perfDrNm);
  204. patientInfoVO.setPerfDrFlag(perfDrFlag);
  205. patientInfoVO.setPerfDrDept(perfDrDept);
  206. patientInfoVO.setOpDiagNm(opDiagNm);
  207. patientInfoVO.setOpNm(opNm);
  208. patientInfoVO.setAnstDrNm1(anstDrNm1);
  209. patientInfoVO.setAnstDrFlag1(anstDrFlag1);
  210. patientInfoVO.setAnstDeptNm1(anstDeptNm1);
  211. patientInfoVO.setAnstDrNm2(anstDrNm2);
  212. patientInfoVO.setAnstDrFlag2(anstDrFlag2);
  213. patientInfoVO.setAnstDeptNm2(anstDeptNm2);
  214. patientInfoVO.setAnstDrNm3(anstDrNm3);
  215. patientInfoVO.setAnstDrFlag3(anstDrFlag3);
  216. patientInfoVO.setAnstDeptNm3(anstDeptNm3);
  217. patientInfoVO.setOpRsrvNo(opRsrvNo);
  218. patientInfoVO.setOrderNo(orderNo);
  219. patientInfoVO.setPrintTime(printTime);
  220. patientInfoVO.setOcrCd(ocrCd);
  221. patientInfoVO.setInputId(inputId);
  222. patientInfoVO.setInputNm(inputNm);
  223. patientInfoVO.setSignImg(signImg);
  224. patientInfoVO.setBp(bp);
  225. patientInfoVO.setDm(dm);
  226. patientInfoVO.setHeart(heart);
  227. patientInfoVO.setKidney(kidney);
  228. patientInfoVO.setRespiration(respiration);
  229. patientInfoVO.setHx(hx);
  230. patientInfoVO.setAllergy(allergy);
  231. patientInfoVO.setDrug(drug);
  232. patientInfoVO.setSmoking(smoking);
  233. patientInfoVO.setIdio(idio);
  234. patientInfoVO.setNacrotics(nacrotics);
  235. patientInfoVO.setAirway(airway);
  236. patientInfoVO.setHemorrhage(hemorrhage);
  237. patientInfoVO.setStatusEt(statusEt);
  238. }
  239. return patientInfoVO;
  240. }
  241. public ArrayList<CategoryVO> getCategoryList(ArrayList<HashMap<String, String>> result) {
  242. String data = result.get(0).get("data");
  243. ArrayList<HashMap<String, String>> rts = Common.parseJSON(mContext, data);
  244. ArrayList<CategoryVO> arrayList = new ArrayList<CategoryVO>();
  245. for (int i = 0; i < rts.size(); i++) {
  246. HashMap<String, String> mm = rts.get(i);
  247. String categoryId = mm.get("categoryId");
  248. String categoryCode = mm.get("categoryCode");
  249. String parentCategoryId = mm.get("parentCategoryId");
  250. String categoryName = mm.get("categoryName");
  251. arrayList.add(new CategoryVO(categoryId, categoryCode, parentCategoryId, categoryName));
  252. }
  253. return arrayList;
  254. }
  255. public ArrayList<ConsentFormListVO> getConsentFormList(ArrayList<HashMap<String, String>> result) {
  256. String data = result.get(0).get("data");
  257. ArrayList<HashMap<String, String>> rts = Common.parseJSON(mContext, data);
  258. ArrayList<ConsentFormListVO> arrayList = new ArrayList<ConsentFormListVO>();
  259. for (int i = 0; i < rts.size(); i++) {
  260. HashMap<String, String> mm = rts.get(i);
  261. String idx = mm.get("idx");
  262. String formId = mm.get("formId");
  263. String formCode = mm.get("formCode");
  264. String formName = mm.get("formName");
  265. String formPrntNm = mm.get("formPrntNm");
  266. String printCnt = mm.get("printCnt");
  267. String certPass = mm.get("certPass");
  268. String pid = mm.get("pid");
  269. String deptEngAggr = mm.get("deptEngAggr");
  270. String consentState = mm.get("consentState");
  271. String consentMstRid = mm.get("consentMstRid");
  272. String ocrTag = mm.get("ocrTag");
  273. String modifyUserId = mm.get("modifyUserId");
  274. String modifyUserNm = mm.get("modifyUserNm");
  275. String modifyDateTime = mm.get("modifyDateTime");
  276. String create_dateTime = mm.get("create_dateTime");
  277. String clnDate = mm.get("clnDate");
  278. String cretNo = mm.get("cretNo");
  279. String ordType = mm.get("ordType");
  280. String deptCd = mm.get("deptCd");
  281. String mainDrId = mm.get("mainDrId");
  282. String patientName = mm.get("patientName");
  283. arrayList.add(new ConsentFormListVO(idx, formId, formCode, formName, formPrntNm, printCnt, certPass, pid, deptEngAggr, consentState, consentMstRid, ocrTag, modifyUserId, modifyUserNm, modifyDateTime, create_dateTime, clnDate, cretNo, ordType, deptCd, mainDrId, patientName));
  284. }
  285. return arrayList;
  286. }
  287. }