|
@@ -76,6 +76,7 @@ func HisProjectRouters() {
|
76
|
76
|
beego.Router("/api/hispatient/getchargeprinttemplate", &HisProjectApiController{}, "Get:GetChargePrintTemplate")
|
77
|
77
|
beego.Router("/api/hispatient/getallhispatient", &HisProjectApiController{}, "Get:GetAllHisPatient")
|
78
|
78
|
beego.Router("/api/hispatient/getchargeprint", &HisProjectApiController{}, "Get:GetChargePrint")
|
|
79
|
+ beego.Router("/api/hispatient/gettodayschedulepatient", &HisProjectApiController{}, "Get:GetTodaySchedulePatient")
|
79
|
80
|
}
|
80
|
81
|
|
81
|
82
|
func (this *HisProjectApiController) SaveProject() {
|
|
@@ -802,6 +803,16 @@ func (this *HisProjectApiController) SaveHisPatient() {
|
802
|
803
|
IsReturn: 1,
|
803
|
804
|
}
|
804
|
805
|
err := service.CreateHisPatient(&patient)
|
|
806
|
+ lastPatient, err := service.GetLastPatient(orgId)
|
|
807
|
+ timeStr := time.Now().Format("2006-01-02")
|
|
808
|
+ timeArr := strings.Split(timeStr, "-")
|
|
809
|
+ var str = timeArr[0] + timeArr[1] + timeArr[2] + strconv.FormatInt(lastPatient.ID, 10)
|
|
810
|
+ fmt.Println("str--------", str)
|
|
811
|
+ hisPatient := models.HisPatient{
|
|
812
|
+ Number: str,
|
|
813
|
+ }
|
|
814
|
+ err = service.UpdateHisPatient(lastPatient.ID, hisPatient)
|
|
815
|
+ fmt.Println("errr", err)
|
805
|
816
|
if err != nil {
|
806
|
817
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
|
807
|
818
|
return
|
|
@@ -1305,6 +1316,7 @@ func (this *HisProjectApiController) GetChargePrint() {
|
1305
|
1316
|
adminUserInfo := this.GetAdminUserInfo()
|
1306
|
1317
|
chargePrint, err := service.GetChargePrint(recordDateTime, patient_id, adminUserInfo.CurrentOrgId)
|
1307
|
1318
|
prescription, err := service.GetHisPrescriptionNight(adminUserInfo.CurrentOrgId, patient_id, recordDateTime, prescription_id)
|
|
1319
|
+ patient, err := service.GetPatientByID(adminUserInfo.CurrentOrgId, patient_id)
|
1308
|
1320
|
if err != nil {
|
1309
|
1321
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
|
1310
|
1322
|
return
|
|
@@ -1312,5 +1324,24 @@ func (this *HisProjectApiController) GetChargePrint() {
|
1312
|
1324
|
this.ServeSuccessJSON(map[string]interface{}{
|
1313
|
1325
|
"list": chargePrint,
|
1314
|
1326
|
"prescription": prescription,
|
|
1327
|
+ "patient": patient,
|
|
1328
|
+ })
|
|
1329
|
+}
|
|
1330
|
+
|
|
1331
|
+func (this *HisProjectApiController) GetTodaySchedulePatient() {
|
|
1332
|
+
|
|
1333
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
1334
|
+ orgId := adminUserInfo.CurrentOrgId
|
|
1335
|
+ recordDateStr := time.Now().Format("2006-01-02")
|
|
1336
|
+ recordDate, _ := utils.ParseTimeStringToTime("2006-01-02", recordDateStr)
|
|
1337
|
+ scheduleDate := recordDate.Unix()
|
|
1338
|
+
|
|
1339
|
+ patient, err := service.GetTodaySchedulePatient(orgId, scheduleDate)
|
|
1340
|
+ if err != nil {
|
|
1341
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
|
|
1342
|
+ return
|
|
1343
|
+ }
|
|
1344
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1345
|
+ "patient": patient,
|
1315
|
1346
|
})
|
1316
|
1347
|
}
|