his_summary_controller.go 24KB

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