|
@@ -33,12 +33,52 @@ func PatientDataConfigAPIControllerRegistRouters() {
|
33
|
33
|
beego.Router("/api/patient/physiquecheck/delete", &PatientDataConfigAPIController{}, "post:DeletePhysiqueCheck")
|
34
|
34
|
beego.Router("/api/patient/physiquecheck/modify", &PatientDataConfigAPIController{}, "get:ModifyPhysiqueCheck")
|
35
|
35
|
|
|
36
|
+ beego.Router("/api/patient/sickhistory/print", &PatientDataConfigAPIController{}, "get:GetSickhistoryPrints")
|
|
37
|
+ beego.Router("/api/patient/physiquecheck/print", &PatientDataConfigAPIController{}, "get:GetPhysiquecheckPrints")
|
|
38
|
+
|
36
|
39
|
}
|
37
|
40
|
|
38
|
41
|
type PatientDataConfigAPIController struct {
|
39
|
42
|
BaseAuthAPIController
|
40
|
43
|
}
|
41
|
44
|
|
|
45
|
+func (this *PatientDataConfigAPIController) GetPhysiquecheckPrints() {
|
|
46
|
+
|
|
47
|
+ patientID, _ := this.GetInt64("patient_id")
|
|
48
|
+ idsStr := this.GetString("ids")
|
|
49
|
+ if patientID <= 0 || len(idsStr) == 0 {
|
|
50
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
51
|
+ return
|
|
52
|
+ }
|
|
53
|
+ recordIDStrs := strings.Split(idsStr, ",")
|
|
54
|
+ patient, _ := service.GetPatientByID(this.GetAdminUserInfo().CurrentOrgId, patientID)
|
|
55
|
+ sickHostory, _ := service.GetPatienttPhysiqueByIds(this.GetAdminUserInfo().CurrentOrgId, patientID, recordIDStrs)
|
|
56
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
57
|
+ "patient": patient,
|
|
58
|
+ "sickhistorys": sickHostory,
|
|
59
|
+ })
|
|
60
|
+
|
|
61
|
+}
|
|
62
|
+func (this *PatientDataConfigAPIController) GetSickhistoryPrints() {
|
|
63
|
+ patientID, _ := this.GetInt64("patient_id")
|
|
64
|
+ idsStr := this.GetString("ids")
|
|
65
|
+ if patientID <= 0 || len(idsStr) == 0 {
|
|
66
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
67
|
+ return
|
|
68
|
+ }
|
|
69
|
+ recordIDStrs := strings.Split(idsStr, ",")
|
|
70
|
+ patient, _ := service.GetPatientByID(this.GetAdminUserInfo().CurrentOrgId, patientID)
|
|
71
|
+ sickHostory, _ := service.GetPatientSickHistoryByIds(this.GetAdminUserInfo().CurrentOrgId, patientID, recordIDStrs)
|
|
72
|
+ for _, item := range sickHostory {
|
|
73
|
+ pc, _ := service.GetLastPatientPhysiqueCheck(this.GetAdminUserInfo().CurrentOrgId, item.PatientId, item.RecordDate)
|
|
74
|
+ item.XtPatientPhysiqueCheck = pc
|
|
75
|
+ }
|
|
76
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
77
|
+ "patient": patient,
|
|
78
|
+ "sickhistorys": sickHostory,
|
|
79
|
+ })
|
|
80
|
+}
|
|
81
|
+
|
42
|
82
|
func (this *PatientDataConfigAPIController) GetSickHistorys() {
|
43
|
83
|
patientID, _ := this.GetInt64("patient_id")
|
44
|
84
|
startTimeYMDStr := this.GetString("start_time")
|
|
@@ -105,8 +145,10 @@ func (this *PatientDataConfigAPIController) CreateSickHistory() {
|
105
|
145
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
106
|
146
|
return
|
107
|
147
|
}
|
|
148
|
+ record_date := strings.Split(record_time_str, " ")
|
108
|
149
|
|
109
|
150
|
checkDate, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", record_time_str)
|
|
151
|
+ checkDate_two, _ := utils.ParseTimeStringToTime("2006-01-02", record_date[0])
|
110
|
152
|
|
111
|
153
|
adminUserInfo := this.GetAdminUserInfo()
|
112
|
154
|
patient, getPatientErr := service.GetPatientByID(adminUserInfo.CurrentOrgId, patientID)
|
|
@@ -135,6 +177,7 @@ func (this *PatientDataConfigAPIController) CreateSickHistory() {
|
135
|
177
|
Ctime: now,
|
136
|
178
|
Mtime: now,
|
137
|
179
|
DoctorId: doctor_id,
|
|
180
|
+ RecordDate: checkDate_two.Unix(),
|
138
|
181
|
}
|
139
|
182
|
|
140
|
183
|
createErr := service.CreatePatientSickHistory(&record)
|
|
@@ -369,7 +412,9 @@ func (this *PatientDataConfigAPIController) CreatePhysiqueCheck() {
|
369
|
412
|
return
|
370
|
413
|
}
|
371
|
414
|
|
|
415
|
+ record_date := strings.Split(record_time_str, " ")
|
372
|
416
|
checkDate, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", record_time_str)
|
|
417
|
+ checkDate_two, _ := utils.ParseTimeStringToTime("2006-01-02", record_date[0])
|
373
|
418
|
|
374
|
419
|
adminUserInfo := this.GetAdminUserInfo()
|
375
|
420
|
patient, getPatientErr := service.GetPatientByID(adminUserInfo.CurrentOrgId, patientID)
|
|
@@ -442,6 +487,7 @@ func (this *PatientDataConfigAPIController) CreatePhysiqueCheck() {
|
442
|
487
|
ShenzhangYatong: shenzhang_yatong,
|
443
|
488
|
FubuDesc: fubu_desc,
|
444
|
489
|
OthDesc: oth_desc,
|
|
490
|
+ RecordDate: checkDate_two.Unix(),
|
445
|
491
|
}
|
446
|
492
|
createErr := service.CreatePatientPhysiqueCheck(&record)
|
447
|
493
|
if createErr != nil {
|