his_summary_controller.go 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  1. package controllers
  2. import (
  3. "XT_New/enums"
  4. "XT_New/service"
  5. "github.com/astaxie/beego"
  6. "time"
  7. )
  8. type HisSummaryApiController struct {
  9. BaseAuthAPIController
  10. }
  11. func HisSummaryApiRegistRouters() {
  12. beego.Router("/api/gethissummarydetaillist", &HisSummaryApiController{}, "Get:GetHisSummaryDetailList")
  13. beego.Router("/api/his/getgatherdetailist", &HisSummaryApiController{}, "Get:GetGatherDetaiList")
  14. beego.Router("/api/his/getdetailpatients", &HisSummaryApiController{}, "Get:GetDetailPatients")
  15. }
  16. func (this *HisSummaryApiController) GetHisSummaryDetailList() {
  17. start_time := this.GetString("start_time")
  18. end_time := this.GetString("end_time")
  19. keyword := this.GetString("keyword")
  20. item_type, _ := this.GetInt64("type")
  21. patient_id, _ := this.GetInt64("patient_id")
  22. adminUser := this.GetAdminUserInfo()
  23. timeLayout := "2006-01-02"
  24. loc, _ := time.LoadLocation("Local")
  25. startTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
  26. if err != nil {
  27. }
  28. startRecordDateTime := startTime.Unix()
  29. endTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
  30. if err != nil {
  31. }
  32. endRecordDateTime := endTime.Unix()
  33. list, err := service.GetHisSummaryDetailList(keyword, item_type, patient_id, adminUser.CurrentOrgId, startRecordDateTime, endRecordDateTime)
  34. patient, _ := service.GetPatientByID(adminUser.CurrentOrgId, patient_id)
  35. his_patient, _ := service.GetHisSummaryPatientInfo(adminUser.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime)
  36. order, _ := service.GetHisLastOrder(adminUser.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime)
  37. his_record_patient, _ := service.GetHisSummaryPatientInfoSix(adminUser.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime)
  38. //获取所有的科室
  39. hisDepatment, _ := service.GetHisDepatment(adminUser.CurrentOrgId)
  40. if err == nil {
  41. this.ServeSuccessJSON(map[string]interface{}{
  42. "list": list,
  43. "patient": patient,
  44. "his_patient": his_patient,
  45. "hisDepatment": hisDepatment,
  46. "order": order,
  47. "his_record_patient": his_record_patient,
  48. })
  49. return
  50. } else {
  51. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  52. return
  53. }
  54. }
  55. func (this *HisSummaryApiController) GetGatherDetaiList() {
  56. start_time := this.GetString("start_time")
  57. end_time := this.GetString("end_time")
  58. keyword := this.GetString("keyword")
  59. item_type, _ := this.GetInt64("type")
  60. patient_id, _ := this.GetInt64("patient_id")
  61. adminUser := this.GetAdminUserInfo()
  62. timeLayout := "2006-01-02"
  63. loc, _ := time.LoadLocation("Local")
  64. startTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
  65. if err != nil {
  66. }
  67. startRecordDateTime := startTime.Unix()
  68. endTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
  69. if err != nil {
  70. }
  71. endRecordDateTime := endTime.Unix()
  72. list, err := service.GetHisSummaryDetailList(keyword, item_type, patient_id, adminUser.CurrentOrgId, startRecordDateTime, endRecordDateTime)
  73. patient, _ := service.GetPatientByID(adminUser.CurrentOrgId, patient_id)
  74. his_patient, _ := service.GetHisSummaryPatientInfo(adminUser.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime)
  75. order, _ := service.GetHisLastOrder(adminUser.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime)
  76. his_record_patient, _ := service.GetHisSummaryPatientInfoSix(adminUser.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime)
  77. //获取所有的科室
  78. hisDepatment, _ := service.GetHisDepatment(adminUser.CurrentOrgId)
  79. var medicalInsuranceLevel = "医保等级"
  80. medicalInsuranceLevelParent, _ := service.GetDrugDataConfig(0, medicalInsuranceLevel)
  81. medicalInsuranceLevelList, _ := service.GetParentDataConfig(medicalInsuranceLevelParent.ID, adminUser.CurrentOrgId)
  82. var drugType = "药品类型"
  83. drugTypeParent, _ := service.GetDrugDataConfig(0, drugType)
  84. drugTypeList, _ := service.GetParentDataConfig(drugTypeParent.ID, adminUser.CurrentOrgId)
  85. var costClassify = "费用类别"
  86. costClassifyParent, _ := service.GetDrugDataConfig(0, costClassify)
  87. costClassifyList, _ := service.GetParentDataConfig(costClassifyParent.ID, adminUser.CurrentOrgId)
  88. doctorlist, _ := service.GetAllDoctorSix(adminUser.CurrentOrgId, adminUser.CurrentAppId)
  89. //获取最后一次排班
  90. schedule, _ := service.GetHisSchedule(patient_id, adminUser.CurrentOrgId, startRecordDateTime, endRecordDateTime)
  91. bedNumber, _ := service.GetAllBedNumberSix(adminUser.CurrentOrgId)
  92. orderInfo, _ := service.GetHisLastOrder(adminUser.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime)
  93. if err == nil {
  94. this.ServeSuccessJSON(map[string]interface{}{
  95. "list": list,
  96. "patient": patient,
  97. "his_patient": his_patient,
  98. "hisDepatment": hisDepatment,
  99. "order": order,
  100. "his_record_patient": his_record_patient,
  101. "medicalInsuranceLevelList": medicalInsuranceLevelList,
  102. "drugTypeList": drugTypeList,
  103. "costClassifyList": costClassifyList,
  104. "doctorlist": doctorlist,
  105. "schedule": schedule,
  106. "bedNumber": bedNumber,
  107. "orderInfo": orderInfo,
  108. })
  109. return
  110. } else {
  111. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  112. return
  113. }
  114. }
  115. //func (this *HisSummaryApiController) GetGatherDetaiList() {
  116. //
  117. // start_time := this.GetString("start_time")
  118. // end_time := this.GetString("end_time")
  119. // keyword := this.GetString("keyword")
  120. // item_type, _ := this.GetInt64("type")
  121. // patient_id, _ := this.GetInt64("patient_id")
  122. // adminUser := this.GetAdminUserInfo()
  123. //
  124. // timeLayout := "2006-01-02"
  125. // loc, _ := time.LoadLocation("Local")
  126. // startTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
  127. // if err != nil {
  128. //
  129. // }
  130. // startRecordDateTime := startTime.Unix()
  131. //
  132. // endTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
  133. // if err != nil {
  134. //
  135. // }
  136. // endRecordDateTime := endTime.Unix()
  137. //
  138. // //查询该病人这段时间的记录单号
  139. // orderInfo, _ := service.GetGatherHisOrder(keyword, item_type, patient_id, adminUser.CurrentOrgId, startRecordDateTime, endRecordDateTime)
  140. //
  141. // org_id := this.GetAdminUserInfo().CurrentOrgId
  142. // appid := this.GetAdminUserInfo().CurrentAppId
  143. // var order_info []*service.HisOrderInfo
  144. //
  145. // var MdtrtId string
  146. //
  147. // patient, _ := service.GetPatientByID(org_id, patient_id)
  148. // for _, item := range orderInfo {
  149. // orderinfo, _ := service.GetHisOrderDetailByNumber(item.Number, org_id)
  150. // MdtrtId = item.MdtrtId
  151. // for _, it := range orderinfo {
  152. //
  153. // order_info = append(order_info, it)
  154. // }
  155. // }
  156. // his, _ := service.GetHisPatientInfoFive(org_id, patient_id, startRecordDateTime, endRecordDateTime)
  157. //
  158. // record, _ := service.GetInHospitalRecordByNumber(MdtrtId)
  159. //
  160. // //获取所有客户
  161. // adminInfo, _ := service.GetAllDoctorSix(org_id, appid)
  162. //
  163. // //获取最后一次排班
  164. // schedule, _ := service.GetHisSchedule(patient_id, org_id, startRecordDateTime, endRecordDateTime)
  165. //
  166. // bedNumber, _ := service.GetAllBedNumberSix(org_id)
  167. // var bedCostTotal float64 = 0 //床位总费
  168. //
  169. // var operationCostTotal float64 = 0 //手术费
  170. //
  171. // var otherCostTotal float64 = 0 //其他费用
  172. //
  173. // var materialCostTotal float64 = 0 //材料费
  174. //
  175. // var westernMedicineCostTotal float64 = 0 //西药费
  176. //
  177. // var chineseTraditionalMedicineCostTotal float64 = 0 //中成药
  178. //
  179. // var checkCostTotal float64 = 0 //检查费
  180. //
  181. // var laboratoryCostTotal float64 = 0 //化验费
  182. //
  183. // var treatCostTotal float64 = 0 //治疗费用
  184. //
  185. // var zhenChaCostTotal float64 = 0 //其他费用
  186. //
  187. // decimal.DivisionPrecision = 2
  188. // var BalanceAccountsType int64
  189. // if his.ID > 0 {
  190. // BalanceAccountsType = his.BalanceAccountsType
  191. // } else {
  192. // BalanceAccountsType = record.BalanceAccountsType
  193. // }
  194. //
  195. // his_patient, _ := service.GetHisSummaryPatientInfo(adminUser.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime)
  196. //
  197. // //获取所有的科室
  198. // hisDepatment, _ := service.GetHisDepatment(adminUser.CurrentOrgId)
  199. //
  200. // //统计
  201. // prescription, _ := service.GetHisPrescriptionTenty(adminUser.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, keyword, item_type)
  202. //
  203. // //orderlist, _ := service.GetHisChargeOrder(adminUser.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, keyword, item_type)
  204. //
  205. // var medicalInsuranceLevel = "医保等级"
  206. // medicalInsuranceLevelParent, _ := service.GetDrugDataConfig(0, medicalInsuranceLevel)
  207. // medicalInsuranceLevelList, _ := service.GetParentDataConfig(medicalInsuranceLevelParent.ID, adminUser.CurrentOrgId)
  208. // if BalanceAccountsType != 2 && BalanceAccountsType > 0 {
  209. // for _, item := range order_info {
  210. // if org_id == 10215 {
  211. // if item.MedChrgitmType == "01" { //床位费
  212. // bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  213. // }
  214. // if item.MedChrgitmType == "02" { //诊察费
  215. // zhenChaCostTotal, _ = decimal.NewFromFloat(zhenChaCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  216. //
  217. // }
  218. // if item.MedChrgitmType == "03" { //检查费
  219. // checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  220. //
  221. // }
  222. //
  223. // if item.MedChrgitmType == "04" { //化验费
  224. // laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  225. // }
  226. //
  227. // if item.MedChrgitmType == "05" || item.MedChrgitmType == "1402" || item.MedChrgitmType == "1403" { //治疗费
  228. // treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  229. //
  230. // }
  231. //
  232. // if item.MedChrgitmType == "06" { //手术费
  233. // operationCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  234. // }
  235. //
  236. // if item.MedChrgitmType == "08" { //材料费
  237. // materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  238. // }
  239. //
  240. // if item.MedChrgitmType == "09" { //西药费
  241. // westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  242. // }
  243. //
  244. // if item.MedChrgitmType == "11" { //中成费
  245. // chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  246. // }
  247. //
  248. // if item.MedChrgitmType == "14" || item.MedChrgitmType == "0" || item.MedChrgitmType == "12" { //其他费
  249. // otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  250. // }
  251. //
  252. // } else if org_id == 10188 || org_id == 10217 {
  253. // if item.MedChrgitmType == "01" { //床位费
  254. // bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  255. //
  256. // }
  257. // if item.MedChrgitmType == "02" { //诊察费
  258. // zhenChaCostTotal, _ = decimal.NewFromFloat(zhenChaCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  259. // }
  260. // if item.MedChrgitmType == "03" { //检查费
  261. // laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  262. // }
  263. //
  264. // if item.MedChrgitmType == "04" { //化验费
  265. // laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  266. // }
  267. //
  268. // if item.MedChrgitmType == "05" || item.MedChrgitmType == "1402" || item.MedChrgitmType == "1403" { //治疗费
  269. // treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  270. // }
  271. //
  272. // if item.MedChrgitmType == "06" { //手术费
  273. // operationCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  274. // }
  275. //
  276. // if item.MedChrgitmType == "08" { //材料费
  277. // materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  278. // }
  279. //
  280. // if item.MedChrgitmType == "09" { //西药费
  281. // westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  282. // }
  283. //
  284. // if item.MedChrgitmType == "11" { //中成费
  285. // chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  286. // }
  287. //
  288. // if item.MedChrgitmType == "14" || item.MedChrgitmType == "0" || item.MedChrgitmType == "12" { //其他费
  289. // otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  290. // }
  291. //
  292. // } else {
  293. //
  294. // if item.MedChrgitmType == "01" { //床位费
  295. // bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  296. //
  297. // }
  298. //
  299. // if item.MedChrgitmType == "03" { //检查费
  300. // checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  301. // }
  302. //
  303. // if item.MedChrgitmType == "04" { //化验费
  304. // laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  305. //
  306. // }
  307. //
  308. // if item.MedChrgitmType == "05" || item.MedChrgitmType == "1402" || item.MedChrgitmType == "1403" { //治疗费
  309. // treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  310. // }
  311. //
  312. // if item.MedChrgitmType == "06" { //手术费
  313. // operationCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  314. // }
  315. //
  316. // if item.MedChrgitmType == "08" { //材料费
  317. // materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  318. // }
  319. //
  320. // if item.MedChrgitmType == "09" { //西药费
  321. // westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  322. // }
  323. //
  324. // if item.MedChrgitmType == "11" { //中成费
  325. // chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  326. // }
  327. //
  328. // if item.MedChrgitmType == "14" || item.MedChrgitmType == "0" || item.MedChrgitmType == "12" || item.MedChrgitmType == "02" { //其他费
  329. // otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  330. //
  331. // }
  332. //
  333. // }
  334. // }
  335. // this.ServeSuccessJSON(map[string]interface{}{
  336. // "order": orderInfo,
  337. // "order_info": order_info,
  338. // "patient": patient,
  339. // "admin_info": adminInfo,
  340. // "his_hospital": record,
  341. // "bedCostTotal": bedCostTotal,
  342. // "operationCostTotal": operationCostTotal,
  343. // "otherCostTotal": otherCostTotal,
  344. // "materialCostTotal": materialCostTotal,
  345. // "westernMedicineCostTotal": westernMedicineCostTotal,
  346. // "chineseTraditionalMedicineCostTotal": chineseTraditionalMedicineCostTotal,
  347. // "checkCostTotal": checkCostTotal,
  348. // "zhenChaCostTotal": zhenChaCostTotal,
  349. // "laboratoryCostTotal": laboratoryCostTotal,
  350. // "treatCostTotal": treatCostTotal,
  351. // "his_patient": his_patient,
  352. // "hisDepatment": hisDepatment,
  353. // "prescription": prescription,
  354. // "schedule": schedule,
  355. // "bedNumber": bedNumber,
  356. // })
  357. // } else {
  358. // for _, item := range order_info {
  359. //
  360. // item.FulamtOwnpayAmt = item.DetItemFeeSumamt
  361. // if item.HisDoctorAdviceInfo.ID > 0 && item.HisPrescriptionProject.ID == 0 { //药品
  362. // item.MedChrgitmType = "09"
  363. // }
  364. // if item.HisPrescriptionProject.ID > 0 && item.HisDoctorAdviceInfo.ID == 0 {
  365. // if item.HisPrescriptionProject.Type == 2 {
  366. // if this.GetAdminUserInfo().CurrentOrgId == 10215 {
  367. // switch item.HisPrescriptionProject.VMHisProject.CostClassify {
  368. // case 0:
  369. // item.MedChrgitmType = "0"
  370. // break
  371. // case 1:
  372. // item.MedChrgitmType = "14"
  373. // break
  374. // case 2:
  375. // item.MedChrgitmType = "05"
  376. //
  377. // break
  378. // case 3:
  379. // item.MedChrgitmType = "03"
  380. //
  381. // break
  382. // case 4:
  383. // item.MedChrgitmType = "03"
  384. //
  385. // break
  386. // case 5:
  387. // item.MedChrgitmType = "08"
  388. //
  389. // break
  390. // case 6:
  391. // item.MedChrgitmType = "14"
  392. //
  393. // break
  394. // case 7:
  395. // item.MedChrgitmType = "14"
  396. //
  397. // break
  398. // case 8:
  399. // item.MedChrgitmType = "03"
  400. // break
  401. // case 9:
  402. // item.MedChrgitmType = "14"
  403. // break
  404. // case 10:
  405. // item.MedChrgitmType = "14"
  406. // break
  407. // case 11:
  408. // item.MedChrgitmType = "06"
  409. // break
  410. // case 12:
  411. // item.MedChrgitmType = "12"
  412. // break
  413. // case 13:
  414. // item.MedChrgitmType = "01"
  415. // break
  416. // case 14:
  417. // item.MedChrgitmType = "04"
  418. // break
  419. // case 15:
  420. // item.MedChrgitmType = "14"
  421. // break
  422. //
  423. // }
  424. //
  425. // } else {
  426. // switch item.HisPrescriptionProject.VMHisProject.CostClassify {
  427. //
  428. // case 1:
  429. // item.MedChrgitmType = "14"
  430. // break
  431. // case 2:
  432. // item.MedChrgitmType = "05"
  433. //
  434. // break
  435. // case 3:
  436. // item.MedChrgitmType = "04"
  437. //
  438. // break
  439. // case 4:
  440. // item.MedChrgitmType = "14"
  441. //
  442. // break
  443. // case 5:
  444. // item.MedChrgitmType = "08"
  445. //
  446. // break
  447. // case 6:
  448. // item.MedChrgitmType = "14"
  449. //
  450. // break
  451. // case 7:
  452. // item.MedChrgitmType = "14"
  453. //
  454. // break
  455. // case 8:
  456. // item.MedChrgitmType = "03"
  457. // break
  458. // case 9:
  459. // item.MedChrgitmType = "14"
  460. // break
  461. // }
  462. // }
  463. // } else if item.HisPrescriptionProject.Type == 3 {
  464. // item.MedChrgitmType = "08"
  465. // }
  466. // }
  467. // }
  468. //
  469. // for _, item := range order_info {
  470. // if org_id == 10215 {
  471. // if item.MedChrgitmType == "01" { //床位费
  472. // bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  473. // }
  474. // if item.MedChrgitmType == "02" { //诊察费
  475. // zhenChaCostTotal, _ = decimal.NewFromFloat(zhenChaCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  476. // }
  477. //
  478. // if item.MedChrgitmType == "03" { //检查费
  479. // checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  480. // }
  481. //
  482. // if item.MedChrgitmType == "04" { //化验费
  483. // laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  484. // }
  485. //
  486. // if item.MedChrgitmType == "05" || item.MedChrgitmType == "1402" || item.MedChrgitmType == "1403" { //治疗费
  487. // treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  488. // }
  489. //
  490. // if item.MedChrgitmType == "06" { //手术费
  491. // operationCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  492. // }
  493. //
  494. // if item.MedChrgitmType == "08" { //材料费
  495. // materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  496. // }
  497. //
  498. // if item.MedChrgitmType == "09" { //西药费
  499. // westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  500. // }
  501. //
  502. // if item.MedChrgitmType == "11" { //中成费
  503. // chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  504. // }
  505. //
  506. // if item.MedChrgitmType == "14" || item.MedChrgitmType == "0" || item.MedChrgitmType == "12" { //其他费
  507. // otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  508. // }
  509. //
  510. // } else {
  511. //
  512. // if item.MedChrgitmType == "01" { //床位费
  513. // bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  514. // }
  515. //
  516. // if item.MedChrgitmType == "03" { //检查费
  517. // checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  518. // }
  519. //
  520. // if item.MedChrgitmType == "04" { //化验费
  521. // laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  522. // }
  523. //
  524. // if item.MedChrgitmType == "05" || item.MedChrgitmType == "1402" || item.MedChrgitmType == "1403" { //治疗费
  525. // treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  526. // }
  527. //
  528. // if item.MedChrgitmType == "06" { //手术费
  529. // operationCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  530. // }
  531. //
  532. // if item.MedChrgitmType == "08" { //材料费
  533. // materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  534. // }
  535. //
  536. // if item.MedChrgitmType == "09" { //西药费
  537. // westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  538. // }
  539. //
  540. // if item.MedChrgitmType == "11" { //中成费
  541. // chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  542. // }
  543. //
  544. // if item.MedChrgitmType == "14" || item.MedChrgitmType == "0" || item.MedChrgitmType == "12" || item.MedChrgitmType == "02" { //其他费
  545. // otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  546. // }
  547. //
  548. // }
  549. //
  550. // }
  551. //
  552. // this.ServeSuccessJSON(map[string]interface{}{
  553. // "order": orderInfo,
  554. // "order_info": order_info,
  555. // "patient": patient,
  556. // "admin_info": adminInfo,
  557. // "his_hospital": record,
  558. // "bedCostTotal": bedCostTotal,
  559. // "operationCostTotal": operationCostTotal,
  560. // "otherCostTotal": otherCostTotal,
  561. // "materialCostTotal": materialCostTotal,
  562. // "westernMedicineCostTotal": westernMedicineCostTotal,
  563. // "chineseTraditionalMedicineCostTotal": chineseTraditionalMedicineCostTotal,
  564. // "checkCostTotal": checkCostTotal,
  565. // "zhenChaCostTotal": zhenChaCostTotal,
  566. // "laboratoryCostTotal": laboratoryCostTotal,
  567. // "treatCostTotal": treatCostTotal,
  568. // "his_patient": his_patient,
  569. // "hisDepatment": hisDepatment,
  570. // "prescription": prescription,
  571. // "balanceAccountsType": BalanceAccountsType,
  572. // "medicalInsuranceLevelList": medicalInsuranceLevelList,
  573. // "schedule": schedule,
  574. // "bedNumber": bedNumber,
  575. // })
  576. //
  577. // }
  578. //}
  579. func (this *HisSummaryApiController) GetDetailPatients() {
  580. keyword := this.GetString("keyword")
  581. orgId := this.GetAdminUserInfo().CurrentOrgId
  582. patients, err := service.GetDetailPatients(keyword, orgId)
  583. if err == nil {
  584. this.ServeSuccessJSON(map[string]interface{}{
  585. "patient": patients,
  586. })
  587. return
  588. } else {
  589. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  590. return
  591. }
  592. }