|
@@ -168,6 +168,10 @@ func PatientApiRegistRouters() {
|
168
|
168
|
|
169
|
169
|
beego.Router("/api/patient/deletepatientdeathsummary", &DialysisApiController{}, "Get:DeletePatientDeathSummary")
|
170
|
170
|
|
|
171
|
+ beego.Router("/api/patient/createnewsickhistoryrecord", &DialysisApiController{}, "Post:CreateNewSickHistoryRecord")
|
|
172
|
+
|
|
173
|
+ beego.Router("/api/patient/getnewsickhistory", &DialysisApiController{}, "Get:GetNewSickHistory")
|
|
174
|
+
|
171
|
175
|
}
|
172
|
176
|
func (c *PatientApiController) GetExportList() {
|
173
|
177
|
startTime := c.GetString("start_time")
|
|
@@ -8159,3 +8163,80 @@ func (c *DialysisApiController) DeletePatientDeathSummary() {
|
8159
|
8163
|
"msg": "删除成功",
|
8160
|
8164
|
})
|
8161
|
8165
|
}
|
|
8166
|
+
|
|
8167
|
+func (this *DialysisApiController) CreateNewSickHistoryRecord() {
|
|
8168
|
+
|
|
8169
|
+ dataBody := make(map[string]interface{}, 0)
|
|
8170
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
8171
|
+ if err != nil {
|
|
8172
|
+ utils.ErrorLog(err.Error())
|
|
8173
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
8174
|
+ return
|
|
8175
|
+ }
|
|
8176
|
+
|
|
8177
|
+ record_date := dataBody["record_time"].(string)
|
|
8178
|
+ timeLayout := "2006-01-02"
|
|
8179
|
+ loc, _ := time.LoadLocation("Local")
|
|
8180
|
+ var recordDate int64
|
|
8181
|
+ if len(record_date) > 0 {
|
|
8182
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
|
|
8183
|
+ if err != nil {
|
|
8184
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
8185
|
+ return
|
|
8186
|
+ }
|
|
8187
|
+ recordDate = theTime.Unix()
|
|
8188
|
+ }
|
|
8189
|
+
|
|
8190
|
+ patient_id := int64(dataBody["patient_id"].(float64))
|
|
8191
|
+
|
|
8192
|
+ doctor_id := int64(dataBody["doctor_id"].(float64))
|
|
8193
|
+
|
|
8194
|
+ guominyaowu_desc := dataBody["guominyaowu_desc"].(string)
|
|
8195
|
+
|
|
8196
|
+ is_fumotouxishi := int64(dataBody["is_fumotouxishi"].(float64))
|
|
8197
|
+
|
|
8198
|
+ is_guominyaowu := int64(dataBody["is_guominyaowu"].(float64))
|
|
8199
|
+
|
|
8200
|
+ is_shenyizhishi := int64(dataBody["is_shenyizhishi"].(float64))
|
|
8201
|
+
|
|
8202
|
+ content := dataBody["content"].(string)
|
|
8203
|
+
|
|
8204
|
+ orgId := this.GetAdminUserInfo().CurrentOrgId
|
|
8205
|
+
|
|
8206
|
+ patientSickHistory := models.XtPatientSickHistory{
|
|
8207
|
+ OrgId: orgId,
|
|
8208
|
+ PatientId: patient_id,
|
|
8209
|
+ Recorder: 0,
|
|
8210
|
+ RecordTime: recordDate,
|
|
8211
|
+ RecordDate: recordDate,
|
|
8212
|
+ Content: content,
|
|
8213
|
+ Status: 1,
|
|
8214
|
+ Ctime: time.Now().Unix(),
|
|
8215
|
+ Mtime: time.Now().Unix(),
|
|
8216
|
+ Title: "",
|
|
8217
|
+ IsShenyizhiHistory: is_shenyizhishi,
|
|
8218
|
+ IsFumoDialysisHistory: is_fumotouxishi,
|
|
8219
|
+ HypersusceptibilityDesc: guominyaowu_desc,
|
|
8220
|
+ DoctorId: doctor_id,
|
|
8221
|
+ IsHypersusceptibility: is_guominyaowu,
|
|
8222
|
+ }
|
|
8223
|
+
|
|
8224
|
+ service.CreateNewSickHistoryRecord(patientSickHistory)
|
|
8225
|
+
|
|
8226
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8227
|
+ "patientSickHistory": patientSickHistory,
|
|
8228
|
+ })
|
|
8229
|
+}
|
|
8230
|
+
|
|
8231
|
+func (this *DialysisApiController) GetNewSickHistory() {
|
|
8232
|
+
|
|
8233
|
+ patient_id, _ := this.GetInt64("patient_id")
|
|
8234
|
+
|
|
8235
|
+ orgId := this.GetAdminUserInfo().CurrentOrgId
|
|
8236
|
+
|
|
8237
|
+ list, _ := service.GetNewSickHistory(patient_id, orgId)
|
|
8238
|
+
|
|
8239
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8240
|
+ "list": list,
|
|
8241
|
+ })
|
|
8242
|
+}
|