his_hospital_api_controller.go 35KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028
  1. package controllers
  2. import (
  3. "XT_New/enums"
  4. "XT_New/models"
  5. "XT_New/service"
  6. "XT_New/utils"
  7. "fmt"
  8. "github.com/astaxie/beego"
  9. "github.com/shopspring/decimal"
  10. "math/rand"
  11. "strconv"
  12. "strings"
  13. "time"
  14. )
  15. type HisHospitalApiController struct {
  16. BaseAuthAPIController
  17. }
  18. func HisHospitalManagerApiRegistRouters() {
  19. beego.Router("/api/hishospitalpatient/list", &HisHospitalApiController{}, "get:GetHisHospitalPatientList")
  20. beego.Router("/api/hospitalcharge/list", &HisHospitalApiController{}, "get:GetHisHospitalChargePatientList")
  21. beego.Router("/api/hospotalcharge/info", &HisHospitalApiController{}, "get:GetHisHospitalChargePatientInfo")
  22. beego.Router("/api/hospitalprescription/list", &HisHospitalApiController{}, "get:GetHisHospitalPrescriptionList")
  23. beego.Router("/api/hospital/inhopitalcheck/get", &HisHospitalApiController{}, "get:GetZHInHospitalCheck")
  24. beego.Router("/api/hospital/outhopitalcheck/get", &HisHospitalApiController{}, "get:GetZHOutHospitalCheck")
  25. beego.Router("/api/hospital/settle/get", &HisHospitalApiController{}, "get:GetSettleInfo")
  26. beego.Router("/api/hospital/inthopitaluncheck/get", &HisHospitalApiController{}, "get:GetZHInHospitalUnCheck")
  27. beego.Router("/api/hospital/outhopitaluncheck/get", &HisHospitalApiController{}, "get:GetZHOutHospitalUnCheck")
  28. beego.Router("/api/hospital/refund", &HisHospitalApiController{}, "get:ZHRefund")
  29. beego.Router("/api/hospital/upload", &HisHospitalApiController{}, "get:GetUploadInfo")
  30. beego.Router("/api/hospital/refunddetail", &HisHospitalApiController{}, "get:RefundDetail")
  31. beego.Router("/api/hospitaldetail/list", &HisHospitalApiController{}, "get:GetHisHospitalDetailPatientList")
  32. beego.Router("/api/hospitaldetail/info", &HisHospitalApiController{}, "get:GetHisHospitalDetailInfo")
  33. beego.Router("/api/monthhospitaldetail/get", &HisHospitalApiController{}, "get:GetHisHospitalMonthDetailInfo")
  34. }
  35. func (c *HisHospitalApiController) RefundDetail() {
  36. patient_id, _ := c.GetInt64("patient_id")
  37. his_patient_id, _ := c.GetInt64("his_patient_id")
  38. record_time := c.GetString("record_time")
  39. settle_accounts_type, _ := c.GetInt64("settle_accounts_type")
  40. timeLayout := "2006-01-02"
  41. loc, _ := time.LoadLocation("Local")
  42. theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_time+" 00:00:00", loc)
  43. if err != nil {
  44. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  45. return
  46. }
  47. recordDateTime := theTime.Unix()
  48. adminUser := c.GetAdminUserInfo()
  49. theTimeTwo, err := time.ParseInLocation(timeLayout+" 15:04:05", record_time+" 23:59:59", loc)
  50. if err != nil {
  51. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  52. return
  53. }
  54. recordDateTimeTwo := theTimeTwo.Unix()
  55. if settle_accounts_type == 1 { //日结
  56. err := service.UpDateOrderInfoStatus(patient_id, recordDateTime, adminUser.CurrentOrgId, recordDateTimeTwo)
  57. if err != nil {
  58. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  59. return
  60. }
  61. err1 := service.UpDatePrescriptionOrderStatusTwo(patient_id, recordDateTime, adminUser.CurrentOrgId)
  62. if err1 != nil {
  63. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  64. return
  65. }
  66. c.ServeSuccessJSON(map[string]interface{}{
  67. "msg": "撤销明细成功",
  68. })
  69. } else {
  70. record, _ := service.GetInHospitalRecord(his_patient_id)
  71. err := service.UpdataHospitalOrderStatusTwo(record.Number, adminUser.CurrentOrgId)
  72. if err == nil {
  73. c.ServeSuccessJSON(map[string]interface{}{
  74. "msg": "撤销明细成功",
  75. })
  76. } else {
  77. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  78. return
  79. }
  80. }
  81. }
  82. func (c *HisHospitalApiController) GetUploadInfo() {
  83. id, _ := c.GetInt64("id")
  84. record_time := c.GetString("record_time")
  85. in_hospital_id, _ := c.GetInt64("in_hospital_id")
  86. settle_accounts_type, _ := c.GetInt64("settle_accounts_type")
  87. timeLayout := "2006-01-02"
  88. loc, _ := time.LoadLocation("Local")
  89. theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_time+" 00:00:00", loc)
  90. if err != nil {
  91. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  92. return
  93. }
  94. recordDateTime := theTime.Unix()
  95. adminUser := c.GetAdminUserInfo()
  96. var prescriptions []*models.HisPrescription
  97. if settle_accounts_type == 1 { //日结
  98. prescriptions, _ = service.GetZHHisPrescription(adminUser.CurrentOrgId, id, recordDateTime)
  99. } else { //月结
  100. start_time_str := c.GetString("start_time")
  101. end_time_str := c.GetString("end_time")
  102. timeLayout := "2006-01-02"
  103. loc, _ := time.LoadLocation("Local")
  104. theStartTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time_str+" 00:00:00", loc)
  105. if err != nil {
  106. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  107. return
  108. }
  109. recordStartTime := theStartTime.Unix()
  110. theEndTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time_str+" 00:00:00", loc)
  111. if err != nil {
  112. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  113. return
  114. }
  115. recordEndTime := theEndTime.Unix()
  116. prescriptions, _ = service.GetZHMonthHisPrescription(adminUser.CurrentOrgId, id, recordStartTime, recordEndTime)
  117. }
  118. record, _ := service.GetInHospitalRecord(in_hospital_id)
  119. if record.ID == 0 {
  120. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  121. return
  122. }
  123. var ids []int64
  124. for _, item := range prescriptions {
  125. ids = append(ids, item.ID)
  126. }
  127. //config, _ := service.GetMedicalInsuranceConfig(adminUser.CurrentOrgId)
  128. var customs []*models.NewCustom
  129. for _, item := range prescriptions {
  130. tm := time.Unix(item.PreTime, 0)
  131. if item.Type == 1 { //药品
  132. for _, subItem := range item.HisDoctorAdviceInfo {
  133. if len(subItem.Drug.MedicalInsuranceNumber) > 0 && subItem.Drug.IsUser != 1 {
  134. //var randNum int
  135. //randNum = rand.Intn(10000) + 1000
  136. cus := &models.NewCustom{
  137. DetItemFeeSumamt: subItem.Price * subItem.PrescribingNumber,
  138. Cut: subItem.PrescribingNumber,
  139. FeedetlSn: subItem.FeedetlSn,
  140. Price: subItem.Price,
  141. MedListCodg: subItem.Drug.MedicalInsuranceNumber,
  142. HospApprFlag: subItem.Drug.HospApprFlag,
  143. FeeOcurTime: tm.Format("2006-01-02 15:04:05"),
  144. }
  145. customs = append(customs, cus)
  146. }
  147. }
  148. }
  149. if item.Type == 2 { //项目
  150. for _, subItem := range item.HisPrescriptionProject {
  151. if subItem.Type == 2 {
  152. if len(subItem.HisProject.MedicalCode) > 0 {
  153. cnt, _ := strconv.ParseFloat(subItem.Count, 64)
  154. cus := &models.NewCustom{
  155. DetItemFeeSumamt: subItem.Price * cnt,
  156. Cut: cnt,
  157. FeedetlSn: subItem.FeedetlSn,
  158. Price: float64(subItem.Price),
  159. MedListCodg: subItem.HisProject.MedicalCode,
  160. HospApprFlag: -1,
  161. FeeOcurTime: tm.Format("2006-01-02 15:04:05"),
  162. }
  163. customs = append(customs, cus)
  164. }
  165. } else if subItem.Type == 3 {
  166. if len(subItem.GoodInfo.MedicalInsuranceNumber) > 0 && subItem.GoodInfo.IsUser != 1 {
  167. cnt, _ := strconv.ParseFloat(subItem.Count, 64)
  168. cus := &models.NewCustom{
  169. DetItemFeeSumamt: subItem.Price * cnt,
  170. Cut: cnt,
  171. FeedetlSn: subItem.FeedetlSn,
  172. Price: float64(subItem.Price),
  173. MedListCodg: subItem.GoodInfo.MedicalInsuranceNumber,
  174. HospApprFlag: -1,
  175. FeeOcurTime: tm.Format("2006-01-02 15:04:05"),
  176. }
  177. customs = append(customs, cus)
  178. }
  179. }
  180. }
  181. }
  182. }
  183. fmt.Println(settle_accounts_type)
  184. if settle_accounts_type == 1 {
  185. fmt.Println(customs)
  186. for _, subItem := range customs {
  187. temp := strings.Split(subItem.FeedetlSn, "-")
  188. var advice_id int64 = 0
  189. var project_id int64 = 0
  190. var types int64 = 0
  191. id, _ := strconv.ParseInt(temp[2], 10, 64)
  192. types, _ = strconv.ParseInt(temp[1], 10, 64)
  193. if temp[1] == "1" {
  194. advice_id = id
  195. project_id = 0
  196. } else if temp[1] == "2" {
  197. advice_id = 0
  198. project_id = id
  199. }
  200. info := &models.HisOrderInfo{
  201. OrderNumber: record.Number,
  202. FeedetlSn: subItem.FeedetlSn,
  203. UploadDate: recordDateTime,
  204. AdviceId: advice_id,
  205. DetItemFeeSumamt: subItem.DetItemFeeSumamt,
  206. Cnt: subItem.Cut,
  207. Pric: float64(subItem.Price),
  208. PatientId: record.PatientId,
  209. PricUplmtAmt: 0,
  210. SelfpayProp: 0,
  211. FulamtOwnpayAmt: 0,
  212. OverlmtAmt: 0,
  213. PreselfpayAmt: 0,
  214. Status: 1,
  215. Mtime: time.Now().Unix(),
  216. Ctime: time.Now().Unix(),
  217. UserOrgId: adminUser.CurrentOrgId,
  218. HisPatientId: record.ID,
  219. OrderId: 0,
  220. ProjectId: project_id,
  221. Type: types,
  222. SettleType: settle_accounts_type,
  223. }
  224. service.CreateOrderInfo(info)
  225. }
  226. err := service.UpDatePrescriptionOrderStatus(adminUser.CurrentOrgId, ids)
  227. service.UpDatePrescriptionNumber(adminUser.CurrentOrgId, ids, record.Number)
  228. service.UpDatePrescriptionInfoNumber(adminUser.CurrentOrgId, record.PatientId, record.Number, recordDateTime)
  229. if err == nil {
  230. c.ServeSuccessJSON(map[string]interface{}{
  231. "msg": "上传费用明细成功",
  232. })
  233. return
  234. } else {
  235. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  236. return
  237. }
  238. } else {
  239. for _, subItem := range customs {
  240. temp := strings.Split(subItem.FeedetlSn, "-")
  241. var advice_id int64 = 0
  242. var project_id int64 = 0
  243. var types int64 = 0
  244. id, _ := strconv.ParseInt(temp[2], 10, 64)
  245. types, _ = strconv.ParseInt(temp[1], 10, 64)
  246. if temp[1] == "1" {
  247. advice_id = id
  248. project_id = 0
  249. } else if temp[1] == "2" {
  250. advice_id = 0
  251. project_id = id
  252. }
  253. info := &models.HisOrderInfo{
  254. OrderNumber: record.Number,
  255. FeedetlSn: subItem.FeedetlSn,
  256. UploadDate: recordDateTime,
  257. AdviceId: advice_id,
  258. DetItemFeeSumamt: subItem.DetItemFeeSumamt,
  259. Cnt: subItem.Cut,
  260. Pric: float64(subItem.Price),
  261. PatientId: record.PatientId,
  262. PricUplmtAmt: 0,
  263. SelfpayProp: 0,
  264. FulamtOwnpayAmt: 0,
  265. OverlmtAmt: 0,
  266. PreselfpayAmt: 0,
  267. Status: 1,
  268. Mtime: time.Now().Unix(),
  269. Ctime: time.Now().Unix(),
  270. UserOrgId: adminUser.CurrentOrgId,
  271. HisPatientId: record.ID,
  272. OrderId: 0,
  273. ProjectId: project_id,
  274. Type: types,
  275. SettleType: settle_accounts_type,
  276. }
  277. service.CreateOrderInfo(info)
  278. }
  279. service.UpDatePrescriptionOrderStatus(adminUser.CurrentOrgId, ids)
  280. service.UpDatePrescriptionNumber(adminUser.CurrentOrgId, ids, record.Number)
  281. service.UpDatePrescriptionInfoNumber(adminUser.CurrentOrgId, record.PatientId, record.Number, recordDateTime)
  282. c.ServeSuccessJSON(map[string]interface{}{
  283. "msg": "上传费用明细成功",
  284. })
  285. }
  286. }
  287. func (c *HisHospitalApiController) GetHisHospitalPatientList() {
  288. record_date := c.GetString("record_date")
  289. types, _ := c.GetInt64("type", 0)
  290. sch_type, _ := c.GetInt64("sch_type", 0)
  291. timeLayout := "2006-01-02"
  292. loc, _ := time.LoadLocation("Local")
  293. theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
  294. if err != nil {
  295. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  296. return
  297. }
  298. recordDateTime := theTime.Unix()
  299. adminInfo := c.GetAdminUserInfo()
  300. //var patients []*service.HospitalPatient
  301. var all_tempPatients []*service.HospitalPatient
  302. tempPatients, _ := service.GetHisHospitalPatientList(adminInfo.CurrentOrgId, recordDateTime, sch_type)
  303. tempPatients_two, _ := service.GetHisHospitalSchPatientList(adminInfo.CurrentOrgId, recordDateTime, sch_type)
  304. if types == 0 {
  305. all_tempPatients, _ = service.GetAllHisHospitalPatientList(adminInfo.CurrentOrgId, recordDateTime, sch_type)
  306. for _, item := range all_tempPatients {
  307. for index, subItem := range tempPatients_two {
  308. if item.ID == subItem.ID {
  309. tempPatients_two = append(tempPatients_two[:index], tempPatients_two[index+1:]...)
  310. }
  311. }
  312. }
  313. all_tempPatients = append(all_tempPatients, tempPatients_two...)
  314. }
  315. //当天有登记住院的和排班同时存在的话,删除掉排班的记录
  316. for _, item := range tempPatients {
  317. for index, subItem := range tempPatients_two {
  318. if item.ID == subItem.ID {
  319. tempPatients_two = append(tempPatients_two[:index], tempPatients_two[index+1:]...)
  320. }
  321. }
  322. }
  323. tempPatients = append(tempPatients, tempPatients_two...)
  324. var total_one int64
  325. var total_two int64
  326. for _, item := range tempPatients {
  327. if item.VMHisPrescriptionInfo.ID == 0 {
  328. total_one = total_one + 1
  329. }
  330. if item.VMHisPrescriptionInfo.ID > 0 {
  331. total_two = total_two + 1
  332. }
  333. }
  334. adminUserInfo, _ := service.GetAdminUserInfoByID(adminInfo.CurrentOrgId, adminInfo.AdminUser.Id)
  335. doctors, _ := service.GetHisAdminUserDoctors(adminInfo.CurrentOrgId)
  336. department, _ := service.GetAllDepartMent(adminInfo.CurrentOrgId)
  337. if types == 0 {
  338. c.ServeSuccessJSON(map[string]interface{}{
  339. "list": all_tempPatients,
  340. "total_one": total_one,
  341. "total_two": total_two,
  342. "info": adminUserInfo,
  343. "doctors": doctors,
  344. "department": department,
  345. })
  346. } else if types == 1 { //未就诊
  347. var patientsOne []*service.HospitalPatient
  348. for _, item := range tempPatients {
  349. if item.VMHisPrescriptionInfo.ID == 0 {
  350. patientsOne = append(patientsOne, item)
  351. }
  352. }
  353. c.ServeSuccessJSON(map[string]interface{}{
  354. "list": patientsOne,
  355. "total_one": total_one,
  356. "total_two": total_two,
  357. "info": adminUserInfo,
  358. "doctors": doctors,
  359. "department": department,
  360. })
  361. } else if types == 2 { //已就诊
  362. var patientsTwo []*service.HospitalPatient
  363. for _, item := range tempPatients {
  364. if item.VMHisPrescriptionInfo.ID > 0 {
  365. patientsTwo = append(patientsTwo, item)
  366. }
  367. }
  368. c.ServeSuccessJSON(map[string]interface{}{
  369. "list": patientsTwo,
  370. "total_one": total_one,
  371. "total_two": total_two,
  372. "info": adminUserInfo,
  373. "doctors": doctors,
  374. "department": department,
  375. })
  376. }
  377. }
  378. func (c *HisHospitalApiController) GetHisHospitalChargePatientList() {
  379. record_date := c.GetString("record_date")
  380. timeLayout := "2006-01-02"
  381. loc, _ := time.LoadLocation("Local")
  382. theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
  383. if err != nil {
  384. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  385. return
  386. }
  387. recordDateTime := theTime.Unix()
  388. adminInfo := c.GetAdminUserInfo()
  389. //tempPatients, _ := service.GetAllChargeHisPatientList(adminInfo.CurrentOrgId, "", recordDateTime)
  390. orders, _ := service.GetNewAllChargeHisHospitalPatientList(adminInfo.CurrentOrgId, recordDateTime)
  391. tempPatients, _ := service.GetNewAllUnChargeHisHospitalPatientList(adminInfo.CurrentOrgId, recordDateTime)
  392. var patients []*models.HisHospitalCheckRecord
  393. for _, item := range tempPatients {
  394. fmt.Println(item.ID)
  395. if item.ID > 0 && item.InHospitalStatus == 1 && item.HisHospitalOrder.OrderStatus != 2 {
  396. patients = append(patients, item)
  397. }
  398. }
  399. c.ServeSuccessJSON(map[string]interface{}{
  400. "list": patients,
  401. "list_two": patients,
  402. "charge_list": orders,
  403. })
  404. }
  405. func (c *HisHospitalApiController) GetHisHospitalChargePatientInfo() {
  406. patient_id, _ := c.GetInt64("patient_id")
  407. his_patient_id, _ := c.GetInt64("his_patient_id")
  408. record_date := c.GetString("record_date")
  409. start_time := c.GetString("start_time")
  410. end_time := c.GetString("end_time")
  411. order_status, _ := c.GetInt64("type", 0)
  412. p_type, _ := c.GetInt64("p_type", 0)
  413. timeLayout := "2006-01-02"
  414. loc, _ := time.LoadLocation("Local")
  415. theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
  416. if err != nil {
  417. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  418. return
  419. }
  420. recordDateTime := theTime.Unix()
  421. startTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
  422. if err != nil {
  423. }
  424. startRecordDateTime := startTime.Unix()
  425. endTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
  426. if err != nil {
  427. }
  428. endRecordDateTime := endTime.Unix()
  429. admin := c.GetAdminUserInfo()
  430. his_patient_info, _ := service.GetNewHisHospitalPatientInfo(his_patient_id)
  431. xt_patient_info, _ := service.GetXTPatientInfo(admin.CurrentOrgId, patient_id)
  432. var prescriptions []*models.HisHospitalPrescription
  433. if order_status == 1 || order_status == 0 {
  434. prescriptions, _ = service.GetNewUnChargeHisHospitalPrescriptionFive(admin.CurrentOrgId, patient_id, his_patient_id, recordDateTime)
  435. } else if order_status == 2 {
  436. prescriptions, _ = service.GetNewChargeHisHospitalPrescriptionFive(admin.CurrentOrgId, patient_id, his_patient_id, recordDateTime)
  437. }
  438. var monthPrescriptions []*models.HisPrescription
  439. var settle_prescriptions []*models.HisHospitalPrescription
  440. if order_status == 1 || order_status == 0 {
  441. monthPrescriptions, _ = service.GetUnChargeMonthHisPrescriptionThree(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
  442. } else if order_status == 2 {
  443. monthPrescriptions, _ = service.GetChargeMonthHisPrescriptionFour(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
  444. }
  445. if order_status == 1 || order_status == 0 {
  446. settle_prescriptions, _ = service.GetSettleHisHospitalPrescription(admin.CurrentOrgId, patient_id, his_patient_info.Number)
  447. } else if order_status == 2 {
  448. settle_prescriptions, _ = service.GetSettleHisHospitalPrescriptionTwo(admin.CurrentOrgId, patient_id, his_patient_info.Number)
  449. }
  450. var settle_total float64
  451. for _, item := range settle_prescriptions {
  452. if len(item.HisPrescriptionProject) > 0 {
  453. for _, subItem := range item.HisPrescriptionProject {
  454. count, _ := strconv.ParseFloat(subItem.Count, 64)
  455. total, _ := decimal.NewFromFloat(count * subItem.Price).Round(2).Float64()
  456. settle_total = settle_total + total
  457. }
  458. }
  459. if len(item.HisDoctorAdviceInfo) > 0 {
  460. for _, subItem := range item.HisDoctorAdviceInfo {
  461. total, _ := decimal.NewFromFloat(subItem.PrescribingNumber * subItem.Price).Round(2).Float64()
  462. settle_total = settle_total + total
  463. }
  464. }
  465. }
  466. settle_total, _ = decimal.NewFromFloat(settle_total).Round(2).Float64()
  467. case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
  468. patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfoTwo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
  469. order, _ := service.GetNewHisOrder(admin.CurrentOrgId, his_patient_info.Number, patient_id)
  470. doctors, _ := service.GetHisAdminUserDoctors(admin.CurrentOrgId)
  471. //获取所有科室信息
  472. department, _ := service.GetAllDepartMent(admin.CurrentOrgId)
  473. c.ServeSuccessJSON(map[string]interface{}{
  474. "his_info": his_patient_info,
  475. "xt_info": xt_patient_info,
  476. "prescription": prescriptions,
  477. "case_history": case_history,
  478. "info": patientPrescriptionInfo,
  479. "month_prescriptions": monthPrescriptions,
  480. "order": order,
  481. "doctors": doctors,
  482. "department": department,
  483. "settle_prescriptions": settle_prescriptions,
  484. "settle_total": settle_total,
  485. })
  486. return
  487. }
  488. func (c *HisHospitalApiController) GetHisHospitalrescriptionList() {
  489. record_date := c.GetString("record_date")
  490. keywords := c.GetString("keywords")
  491. page, _ := c.GetInt64("page")
  492. limit, _ := c.GetInt64("limit")
  493. timeLayout := "2006-01-02"
  494. loc, _ := time.LoadLocation("Local")
  495. theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
  496. if err != nil {
  497. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  498. return
  499. }
  500. recordDateTime := theTime.Unix()
  501. adminInfo := c.GetAdminUserInfo()
  502. prescriptionOrder, err, total := service.GetHisPatientPrescriptionList(adminInfo.CurrentOrgId, keywords, recordDateTime, page, limit)
  503. //adminInfo := c.GetAdminUserInfo()
  504. //prescriptionOrder, err := service.GetHisPrescriptionOrderList(adminInfo.CurrentOrgId)
  505. //fmt.Println(prescriptionOrder)
  506. if err == nil {
  507. c.ServeSuccessJSON(map[string]interface{}{
  508. "order": prescriptionOrder,
  509. "total": total,
  510. })
  511. } else {
  512. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  513. return
  514. }
  515. }
  516. func (c *HisHospitalApiController) GetHisHospitalPrescriptionList() {
  517. record_date := c.GetString("record_date")
  518. keywords := c.GetString("keywords")
  519. page, _ := c.GetInt64("page")
  520. limit, _ := c.GetInt64("limit")
  521. timeLayout := "2006-01-02"
  522. loc, _ := time.LoadLocation("Local")
  523. theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
  524. if err != nil {
  525. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  526. return
  527. }
  528. recordDateTime := theTime.Unix()
  529. adminInfo := c.GetAdminUserInfo()
  530. prescriptionOrder, err, total := service.GetHisHospitalPatientPrescriptionList(adminInfo.CurrentOrgId, keywords, recordDateTime, page, limit)
  531. if err == nil {
  532. c.ServeSuccessJSON(map[string]interface{}{
  533. "order": prescriptionOrder,
  534. "total": total,
  535. })
  536. } else {
  537. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  538. return
  539. }
  540. }
  541. func (c *HisHospitalApiController) GetZHInHospitalCheck() {
  542. id, _ := c.GetInt64("id")
  543. record_time := c.GetString("record_time")
  544. name := c.GetString("name")
  545. phone := c.GetString("phone")
  546. id_card_type, _ := c.GetInt64("id_card_type")
  547. certificates, _ := c.GetInt64("certificates")
  548. id_card_no := c.GetString("id_card_no")
  549. doctor, _ := c.GetInt64("doctor")
  550. admin_user_id, _ := c.GetInt64("admin_user_id")
  551. department, _ := c.GetInt64("department")
  552. adm_bed, _ := c.GetInt64("adm_bed")
  553. diagnosis_ids := c.GetString("diagnosis")
  554. sick_type, _ := c.GetInt64("sick_type")
  555. start_time := c.GetString("start_time")
  556. balance_accounts_type, _ := c.GetInt64("balance_accounts_type")
  557. med_type, _ := c.GetInt64("med_type")
  558. timeLayout := "2006-01-02"
  559. loc, _ := time.LoadLocation("Local")
  560. theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_time+" 00:00:00", loc)
  561. if err != nil {
  562. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  563. return
  564. }
  565. recordDateTime := theTime.Unix()
  566. adminInfo := c.GetAdminUserInfo()
  567. record, _ := service.GetLastHospitalRecord(id, adminInfo.CurrentOrgId)
  568. if record.ID != 0 {
  569. if record.InHospitalStatus == 1 && record.OutHospitalStatus != 1 {
  570. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHospitalExistDataException)
  571. return
  572. }
  573. }
  574. timestamp := time.Now().Unix()
  575. tempTime := time.Unix(timestamp, 0)
  576. timeFormat := tempTime.Format("20060102150405")
  577. chrgBchno := rand.Intn(100000) + 10000
  578. ipt_otp_no := timeFormat + strconv.FormatInt(int64(chrgBchno), 10) + strconv.FormatInt(id, 10)
  579. timeStr := time.Now().Format("2006-01-02 15:04:05")
  580. fmt.Println(timeStr)
  581. timeArr := strings.Split(timeStr, " ")
  582. fmt.Println(timeArr)
  583. timeArrTwo := strings.Split(timeArr[0], "-")
  584. timeArrThree := strings.Split(timeArr[1], ":")
  585. var str = timeArrTwo[0] + timeArrTwo[1] + timeArrTwo[2] + timeArrThree[0] + timeArrThree[1] + timeArrThree[2] + strconv.FormatInt(id, 10)
  586. inHospital := &models.HisHospitalCheckRecord{
  587. PatientId: id,
  588. Name: name,
  589. MedicalTreatmentType: med_type,
  590. RecordDate: recordDateTime,
  591. IdCardNo: id_card_no,
  592. AdminUserId: admin_user_id,
  593. Departments: department,
  594. UserOrgId: adminInfo.CurrentOrgId,
  595. Status: 1,
  596. Ctime: time.Now().Unix(),
  597. Mtime: time.Now().Unix(),
  598. Number: str,
  599. Doctor: doctor,
  600. Certno: id_card_no,
  601. MedType: med_type,
  602. IptOtpNo: ipt_otp_no,
  603. AdmBed: adm_bed,
  604. IdCardType: id_card_type,
  605. Diagnosis: diagnosis_ids,
  606. SickType: sick_type,
  607. MdtrtCertType: "02",
  608. InHosptialTime: start_time,
  609. OutHosptialTime: "",
  610. InHospitalStatus: 1,
  611. Certificates: certificates,
  612. Phone: phone,
  613. BalanceAccountsType: balance_accounts_type,
  614. }
  615. service.CreateHospitalRecord(inHospital)
  616. c.ServeSuccessJSON(map[string]interface{}{
  617. "msg": "办理入院成功",
  618. "info": inHospital,
  619. })
  620. }
  621. func (this *HisHospitalApiController) GetZHOutHospitalCheck() {
  622. id, _ := this.GetInt64("id")
  623. record_time := this.GetString("record_time")
  624. out_time := this.GetString("out_time")
  625. record, _ := service.GetInHospitalRecord(id)
  626. if record.ID == 0 {
  627. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeInHospitalNoExistDataException)
  628. return
  629. }
  630. timeLayout := "2006-01-02"
  631. loc, _ := time.LoadLocation("Local")
  632. theTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_time+" 00:00:00", loc)
  633. recordDateTime := theTime.Unix()
  634. //timestamp := time.Now().Unix()
  635. //tempTime := time.Unix(timestamp, 0)
  636. //timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
  637. record.OutHospitalStatus = 1
  638. record.OutHosptialTime = out_time
  639. record.OutWay = 1
  640. service.CreateHospitalRecord(&record)
  641. orders, _ := service.GetHisOrderInfoByNumberFour(record.Number)
  642. var total float64
  643. for _, item := range orders {
  644. total = total + item.DetItemFeeSumamt
  645. }
  646. order := &models.HisOrder{
  647. UserOrgId: this.GetAdminUserInfo().CurrentOrgId,
  648. HisPatientId: record.ID,
  649. PatientId: record.PatientId,
  650. SettleAccountsDate: recordDateTime,
  651. Ctime: time.Now().Unix(),
  652. Mtime: time.Now().Unix(),
  653. Status: 1,
  654. Number: record.Number,
  655. Infcode: 0,
  656. WarnMsg: "",
  657. Cainfo: "",
  658. ErrMsg: "",
  659. RespondTime: "",
  660. InfRefmsgid: "",
  661. OrderStatus: 1,
  662. MdtrtId: record.Number,
  663. IsMedicineInsurance: 1,
  664. PType: 1,
  665. MedfeeSumamt: total,
  666. PsnPartAmt: total,
  667. }
  668. err := service.CreateOrder(order)
  669. if err != nil {
  670. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  671. return
  672. }
  673. this.ServeSuccessJSON(map[string]interface{}{
  674. "msg": "出院成功",
  675. })
  676. }
  677. func (c *HisHospitalApiController) GetSettleInfo() {
  678. order_id, _ := c.GetInt64("order_id")
  679. in_hospital_id, _ := c.GetInt64("in_hospital_id")
  680. pay_way, _ := c.GetInt64("pay_way")
  681. pay_price, _ := c.GetFloat("pay_price")
  682. pay_card_no := c.GetString("pay_card_no")
  683. discount_price, _ := c.GetFloat("discount_price")
  684. preferential_price, _ := c.GetFloat("preferential_price")
  685. reality_price, _ := c.GetFloat("reality_price")
  686. found_price, _ := c.GetFloat("found_price")
  687. medical_insurance_price, _ := c.GetFloat("medical_insurance_price")
  688. private_price, _ := c.GetFloat("private_price")
  689. fapiao_code := c.GetString("fapiao_code")
  690. fapiao_number := c.GetString("fapiao_number")
  691. id, _ := c.GetInt64("patient_id")
  692. dec_way := c.GetString("dec_way") //是否使用押金支付bool类型
  693. tmp_decimal := c.GetString("tmp_decimal")
  694. var decimal float64 //本次使用的押金
  695. var errmsg error
  696. tx := service.XTWriteDB().Begin() //开了事务
  697. //只检测扣费函数SpendDeposit有没有返回错误,如果有则回滚所有以TX结尾的方法(去掉TX即为原先的方法)
  698. defer func() {
  699. if errmsg != nil {
  700. utils.ErrorLog("事务失败,原因为: %v", errmsg.Error())
  701. tx.Rollback()
  702. } else {
  703. tx.Commit()
  704. }
  705. }()
  706. if dec_way == "true" && tmp_decimal == "0" || dec_way == "true" && tmp_decimal == "" {
  707. c.ServeFailJsonSend(enums.ErrorCodeParamWrong, "押金不能为0")
  708. return
  709. }
  710. if len(tmp_decimal) > 0 {
  711. if tmp_decimal[0] == 45 {
  712. c.ServeFailJsonSend(enums.ErrorCodeParamWrong, "押金不能为负数")
  713. return
  714. }
  715. }
  716. tt, errs := strconv.ParseFloat(tmp_decimal, 64)
  717. if errs != nil {
  718. c.ServeFailJsonSend(enums.ErrorCodeParamWrong, "押金金额错误")
  719. return
  720. }
  721. decimal = tt
  722. record, _ := service.GetInHospitalRecordTX(in_hospital_id, tx)
  723. order, _ := service.GetHisOrderByIDTX(order_id, tx)
  724. chrg_bchno := order.Number
  725. if record.ID == 0 {
  726. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  727. return
  728. }
  729. if record.InHospitalStatus == 1 && record.OutHospitalStatus == 0 {
  730. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHospitalNoExistDataException)
  731. return
  732. }
  733. order.OrderStatus = 2
  734. order.DiscountPrice = discount_price
  735. order.MedicalInsurancePrice = medical_insurance_price
  736. order.FaPiaoNumber = fapiao_number
  737. order.FaPiaoCode = fapiao_code
  738. order.PayWay = pay_way
  739. order.PayPrice = pay_price
  740. order.PayCardNo = pay_card_no
  741. order.PreferentialPrice = preferential_price
  742. order.RealityPrice = reality_price
  743. order.FoundPrice = found_price
  744. order.PrivatePrice = private_price
  745. order.MdtrtId = record.Number
  746. order.MedfeeSumamt = order.MedfeeSumamt
  747. order.Decimal = decimal
  748. //order.SetlTime =
  749. err := service.UpdataOrderStatusTwoTX(chrg_bchno, c.GetAdminUserInfo().CurrentOrgId, tx)
  750. err = service.UpDateOrderTX(order, tx)
  751. //判断是否使用了押金
  752. if dec_way == "true" {
  753. tmpstring := strconv.FormatInt(order.ID, 10)
  754. //扣押金
  755. errmsg = service.SpendDeposit(c.GetAdminUserInfo().CurrentOrgId, id, c.GetAdminUserInfo().AdminUser.Id, tmpstring, decimal)
  756. if errmsg != nil {
  757. c.ServeFailJsonSend(enums.ErrorCodeParamWrong, errmsg.Error())
  758. //c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateOrderException)
  759. return
  760. }
  761. }
  762. if err == nil {
  763. c.ServeSuccessJSON(map[string]interface{}{
  764. "msg": "结算成功",
  765. })
  766. } else {
  767. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  768. return
  769. }
  770. }
  771. func (c *HisHospitalApiController) ZHRefund() {
  772. order_id, _ := c.GetInt64("order_id")
  773. order, _ := service.GetHisOrderByID(order_id)
  774. adminUser := c.GetAdminUserInfo()
  775. orgid := c.GetAdminUserInfo().CurrentOrgId
  776. err := service.UpdataHospitalOrderStatus(order_id, order.Number, adminUser.CurrentOrgId, "", "")
  777. if err != nil {
  778. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  779. return
  780. }
  781. tmp := strconv.FormatInt(order.ID, 10)
  782. //当押金不为零时产生退费记录
  783. if order.Decimal != 0 {
  784. err = service.MoneyIncrease(orgid, order.PatientId, tmp, order.Decimal)
  785. if err != nil {
  786. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  787. return
  788. }
  789. }
  790. c.ServeSuccessJSON(map[string]interface{}{
  791. "msg": "退费成功",
  792. })
  793. }
  794. func (this *HisHospitalApiController) GetZHOutHospitalUnCheck() {
  795. id, _ := this.GetInt64("id")
  796. record, _ := service.GetInHospitalRecord(id)
  797. if record.ID == 0 {
  798. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeInHospitalNoExistDataException)
  799. return
  800. }
  801. record.OutHospitalStatus = 0
  802. service.CreateHospitalRecord(&record)
  803. this.ServeSuccessJSON(map[string]interface{}{
  804. "msg": "撤销出院成功",
  805. })
  806. }
  807. func (this *HisHospitalApiController) GetZHInHospitalUnCheck() {
  808. id, _ := this.GetInt64("id")
  809. record, _ := service.GetInHospitalRecord(id)
  810. if record.ID == 0 {
  811. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeInHospitalNoExistDataException)
  812. return
  813. }
  814. record.Status = 0
  815. service.CreateHospitalRecord(&record)
  816. this.ServeSuccessJSON(map[string]interface{}{
  817. "msg": "撤销入院成功",
  818. })
  819. }
  820. func (c *HisHospitalApiController) GetHisHospitalDetailPatientList() {
  821. record_date := c.GetString("record_date")
  822. sch_type, _ := c.GetInt64("sch_type")
  823. timeLayout := "2006-01-02"
  824. loc, _ := time.LoadLocation("Local")
  825. theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
  826. if err != nil {
  827. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  828. return
  829. }
  830. recordDateTime := theTime.Unix()
  831. adminInfo := c.GetAdminUserInfo()
  832. UnUploadPrescriptionPatients, _ := service.GetHisHospitalUnUploadPrescriptionDetailPatientList(adminInfo.CurrentOrgId, recordDateTime, sch_type)
  833. UploadPrescriptionPatients, _ := service.GetHisHospitalUploadPrescriptionDetailPatientList(adminInfo.CurrentOrgId, recordDateTime, sch_type)
  834. //var patients []*models.HisHospitalCheckRecord
  835. /* for _, item := range tempPatients {
  836. fmt.Println(item.ID)
  837. if item.ID > 0 && item.InHospitalStatus == 1 && item.HisHospitalOrder.OrderStatus != 2 {
  838. patients = append(patients, item)
  839. }
  840. }*/
  841. c.ServeSuccessJSON(map[string]interface{}{
  842. "list": UnUploadPrescriptionPatients,
  843. "list_two": UploadPrescriptionPatients,
  844. "upload_num": len(UploadPrescriptionPatients),
  845. "un_upload_num": len(UnUploadPrescriptionPatients),
  846. })
  847. }
  848. func (c *HisHospitalApiController) GetHisHospitalDetailInfo() {
  849. record_date := c.GetString("record_date")
  850. id, _ := c.GetInt64("id")
  851. is_upload, _ := c.GetInt64("is_upload")
  852. patient_id, _ := c.GetInt64("patient_id")
  853. start_time_str := c.GetString("start_time")
  854. end_time_str := c.GetString("end_time")
  855. record, _ := service.GetInHospitalRecord(id)
  856. timeLayout := "2006-01-02"
  857. loc, _ := time.LoadLocation("Local")
  858. theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
  859. if err != nil {
  860. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  861. return
  862. }
  863. recordDateTime := theTime.Unix()
  864. adminInfo := c.GetAdminUserInfo()
  865. theStartTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time_str+" 00:00:00", loc)
  866. if err != nil {
  867. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  868. return
  869. }
  870. recordStartTime := theStartTime.Unix()
  871. theEndTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time_str+" 00:00:00", loc)
  872. if err != nil {
  873. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  874. return
  875. }
  876. recordEndTime := theEndTime.Unix()
  877. var prescriptions []*models.HisPrescription
  878. if is_upload == 1 { //未上传
  879. prescriptions, _ = service.GetUnUploadHisHospitalPrescription(adminInfo.CurrentOrgId, patient_id, recordDateTime)
  880. } else if is_upload == 2 { //已上传
  881. prescriptions, _ = service.GetUploadHisHospitalPrescription(adminInfo.CurrentOrgId, patient_id, recordDateTime)
  882. }
  883. var monthPrescriptions []*models.HisPrescription
  884. if is_upload == 1 {
  885. monthPrescriptions, _ = service.GetMonthUnUploadHisHospitalPrescription(adminInfo.CurrentOrgId, patient_id, recordStartTime, recordEndTime)
  886. } else if is_upload == 2 {
  887. monthPrescriptions, _ = service.GetMonthUploadHisHospitalPrescription(adminInfo.CurrentOrgId, patient_id, recordStartTime, recordEndTime)
  888. }
  889. c.ServeSuccessJSON(map[string]interface{}{
  890. "prescription": prescriptions,
  891. "month_prescriptions": monthPrescriptions,
  892. "his_info": record,
  893. })
  894. }
  895. func (c *HisHospitalApiController) GetHisHospitalMonthDetailInfo() {
  896. id, _ := c.GetInt64("id")
  897. is_upload, _ := c.GetInt64("is_upload")
  898. patient_id, _ := c.GetInt64("patient_id")
  899. start_time_str := c.GetString("start_time")
  900. end_time_str := c.GetString("end_time")
  901. record, _ := service.GetInHospitalRecord(id)
  902. timeLayout := "2006-01-02"
  903. loc, _ := time.LoadLocation("Local")
  904. adminInfo := c.GetAdminUserInfo()
  905. theStartTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time_str+" 00:00:00", loc)
  906. if err != nil {
  907. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  908. return
  909. }
  910. recordStartTime := theStartTime.Unix()
  911. theEndTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time_str+" 00:00:00", loc)
  912. if err != nil {
  913. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  914. return
  915. }
  916. recordEndTime := theEndTime.Unix()
  917. //var prescriptions []*models.HisPrescription
  918. var monthPrescriptions []*models.HisPrescription
  919. if is_upload == 1 {
  920. monthPrescriptions, _ = service.GetMonthUnUploadHisHospitalPrescription(adminInfo.CurrentOrgId, patient_id, recordStartTime, recordEndTime)
  921. } else if is_upload == 2 {
  922. monthPrescriptions, _ = service.GetMonthUploadHisHospitalPrescription(adminInfo.CurrentOrgId, patient_id, recordStartTime, recordEndTime)
  923. } else {
  924. monthPrescriptions, _ = service.GetAllMonthHisHospitalPrescription(adminInfo.CurrentOrgId, patient_id, recordStartTime, recordEndTime)
  925. }
  926. c.ServeSuccessJSON(map[string]interface{}{
  927. "month_prescriptions": monthPrescriptions,
  928. "his_info": record,
  929. })
  930. }