|
@@ -168,9 +168,27 @@ 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")
|
|
171
|
+ beego.Router("/api/patient/createnewsickhistoryrecord", &PatientApiController{}, "Post:CreateNewSickHistoryRecord")
|
172
|
172
|
|
173
|
|
- beego.Router("/api/patient/getnewsickhistory", &DialysisApiController{}, "Get:GetNewSickHistory")
|
|
173
|
+ beego.Router("/api/patient/getnewsickhistory", &PatientApiController{}, "Get:GetNewSickHistory")
|
|
174
|
+
|
|
175
|
+ beego.Router("/api/patient/deletenewsickhistory", &PatientApiController{}, "Get:DeleteNewSickHistory")
|
|
176
|
+
|
|
177
|
+ beego.Router("/api/patient/savesickhistorytemplate", &PatientApiController{}, "Post:SaveSickHistoryTemplate")
|
|
178
|
+
|
|
179
|
+ beego.Router("/api/patient/getsickhistorytemplate", &PatientApiController{}, "Get:GetSickHistoryTemplate")
|
|
180
|
+
|
|
181
|
+ beego.Router("/api/patient/modifysickhistorytemplate", &PatientApiController{}, "Post:ModifySickHistoryTemplate")
|
|
182
|
+
|
|
183
|
+ beego.Router("/api/patient/deletesickhistorytemplate", &PatientApiController{}, "Get:DeleteSickHistoryTemplate")
|
|
184
|
+
|
|
185
|
+ beego.Router("/api/patient/createnewcourseofdiseaserecord", &PatientApiController{}, "Post:CreateNewCourseOfDiaseaseRecord")
|
|
186
|
+
|
|
187
|
+ beego.Router("/api/patient/getpatientcourseofdiseaseslist", &PatientApiController{}, "Get:GetPatientCoureseOfDiseasesList")
|
|
188
|
+
|
|
189
|
+ beego.Router("/api/patient/deletenewcourseofdisease", &PatientApiController{}, "Get:DeleteNewCourseOfDisease")
|
|
190
|
+
|
|
191
|
+ beego.Router("/api/patient/createnewcouresetemplate", &PatientApiController{}, "Post:CreateNewCourseTemplate")
|
174
|
192
|
|
175
|
193
|
}
|
176
|
194
|
func (c *PatientApiController) GetExportList() {
|
|
@@ -8164,7 +8182,7 @@ func (c *DialysisApiController) DeletePatientDeathSummary() {
|
8164
|
8182
|
})
|
8165
|
8183
|
}
|
8166
|
8184
|
|
8167
|
|
-func (this *DialysisApiController) CreateNewSickHistoryRecord() {
|
|
8185
|
+func (this *PatientApiController) CreateNewSickHistoryRecord() {
|
8168
|
8186
|
|
8169
|
8187
|
dataBody := make(map[string]interface{}, 0)
|
8170
|
8188
|
err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
@@ -8187,6 +8205,8 @@ func (this *DialysisApiController) CreateNewSickHistoryRecord() {
|
8187
|
8205
|
recordDate = theTime.Unix()
|
8188
|
8206
|
}
|
8189
|
8207
|
|
|
8208
|
+ id := int64(dataBody["id"].(float64))
|
|
8209
|
+
|
8190
|
8210
|
patient_id := int64(dataBody["patient_id"].(float64))
|
8191
|
8211
|
|
8192
|
8212
|
doctor_id := int64(dataBody["doctor_id"].(float64))
|
|
@@ -8204,6 +8224,7 @@ func (this *DialysisApiController) CreateNewSickHistoryRecord() {
|
8204
|
8224
|
orgId := this.GetAdminUserInfo().CurrentOrgId
|
8205
|
8225
|
|
8206
|
8226
|
patientSickHistory := models.XtPatientSickHistory{
|
|
8227
|
+ ID: id,
|
8207
|
8228
|
OrgId: orgId,
|
8208
|
8229
|
PatientId: patient_id,
|
8209
|
8230
|
Recorder: 0,
|
|
@@ -8228,7 +8249,7 @@ func (this *DialysisApiController) CreateNewSickHistoryRecord() {
|
8228
|
8249
|
})
|
8229
|
8250
|
}
|
8230
|
8251
|
|
8231
|
|
-func (this *DialysisApiController) GetNewSickHistory() {
|
|
8252
|
+func (this *PatientApiController) GetNewSickHistory() {
|
8232
|
8253
|
|
8233
|
8254
|
patient_id, _ := this.GetInt64("patient_id")
|
8234
|
8255
|
|
|
@@ -8240,3 +8261,185 @@ func (this *DialysisApiController) GetNewSickHistory() {
|
8240
|
8261
|
"list": list,
|
8241
|
8262
|
})
|
8242
|
8263
|
}
|
|
8264
|
+
|
|
8265
|
+func (this *PatientApiController) DeleteNewSickHistory() {
|
|
8266
|
+
|
|
8267
|
+ id, _ := this.GetInt64("id")
|
|
8268
|
+
|
|
8269
|
+ service.DeleteNewSickHistory(id)
|
|
8270
|
+
|
|
8271
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8272
|
+ "msg": "ok",
|
|
8273
|
+ })
|
|
8274
|
+}
|
|
8275
|
+
|
|
8276
|
+func (this *PatientApiController) SaveSickHistoryTemplate() {
|
|
8277
|
+
|
|
8278
|
+ dataBody := make(map[string]interface{}, 0)
|
|
8279
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
8280
|
+ if err != nil {
|
|
8281
|
+ utils.ErrorLog(err.Error())
|
|
8282
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
8283
|
+ return
|
|
8284
|
+ }
|
|
8285
|
+
|
|
8286
|
+ title := dataBody["title"].(string)
|
|
8287
|
+
|
|
8288
|
+ content := dataBody["content"].(string)
|
|
8289
|
+
|
|
8290
|
+ orgId := this.GetAdminUserInfo().CurrentOrgId
|
|
8291
|
+
|
|
8292
|
+ sickHistoryTemplate := models.XtSickHistoryTemplate{
|
|
8293
|
+ Content: content,
|
|
8294
|
+ UserOrgId: orgId,
|
|
8295
|
+ Title: title,
|
|
8296
|
+ Ctime: time.Now().Unix(),
|
|
8297
|
+ Mtime: time.Now().Unix(),
|
|
8298
|
+ Status: 1,
|
|
8299
|
+ }
|
|
8300
|
+
|
|
8301
|
+ service.CreateSickHistoryTemplate(sickHistoryTemplate)
|
|
8302
|
+
|
|
8303
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8304
|
+ "sickHistoryTemplate": "sickHistoryTemplate",
|
|
8305
|
+ })
|
|
8306
|
+}
|
|
8307
|
+
|
|
8308
|
+func (this *PatientApiController) GetSickHistoryTemplate() {
|
|
8309
|
+
|
|
8310
|
+ orgId := this.GetAdminUserInfo().CurrentOrgId
|
|
8311
|
+
|
|
8312
|
+ templateList, _ := service.GetSickHistoryTemplate(orgId)
|
|
8313
|
+
|
|
8314
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8315
|
+ "templateList": templateList,
|
|
8316
|
+ })
|
|
8317
|
+}
|
|
8318
|
+
|
|
8319
|
+func (this *PatientApiController) ModifySickHistoryTemplate() {
|
|
8320
|
+
|
|
8321
|
+ dataBody := make(map[string]interface{}, 0)
|
|
8322
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
8323
|
+ if err != nil {
|
|
8324
|
+ utils.ErrorLog(err.Error())
|
|
8325
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
8326
|
+ return
|
|
8327
|
+ }
|
|
8328
|
+
|
|
8329
|
+ template_id := int64(dataBody["template_id"].(float64))
|
|
8330
|
+ content := dataBody["content"].(string)
|
|
8331
|
+
|
|
8332
|
+ service.ModifySickHistoryTemplate(template_id, content)
|
|
8333
|
+
|
|
8334
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8335
|
+ "msg": "ok",
|
|
8336
|
+ })
|
|
8337
|
+}
|
|
8338
|
+
|
|
8339
|
+func (this *PatientApiController) DeleteSickHistoryTemplate() {
|
|
8340
|
+
|
|
8341
|
+ template_id, _ := this.GetInt64("template_id")
|
|
8342
|
+
|
|
8343
|
+ service.DeleteSickHistoryTemplate(template_id)
|
|
8344
|
+
|
|
8345
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8346
|
+ "msg": "ok",
|
|
8347
|
+ })
|
|
8348
|
+}
|
|
8349
|
+
|
|
8350
|
+func (this *PatientApiController) CreateNewCourseOfDiaseaseRecord() {
|
|
8351
|
+
|
|
8352
|
+ dataBody := make(map[string]interface{}, 0)
|
|
8353
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
8354
|
+ if err != nil {
|
|
8355
|
+ utils.ErrorLog(err.Error())
|
|
8356
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
8357
|
+ return
|
|
8358
|
+ }
|
|
8359
|
+
|
|
8360
|
+ patient_id := int64(dataBody["patient_id"].(float64))
|
|
8361
|
+
|
|
8362
|
+ record_date := dataBody["record_date"].(string)
|
|
8363
|
+
|
|
8364
|
+ id := int64(dataBody["id"].(float64))
|
|
8365
|
+
|
|
8366
|
+ recordDate, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", record_date)
|
|
8367
|
+
|
|
8368
|
+ content := dataBody["content"].(string)
|
|
8369
|
+ admin_user_id := int64(dataBody["admin_user_id"].(float64))
|
|
8370
|
+
|
|
8371
|
+ orgId := this.GetAdminUserInfo().CurrentOrgId
|
|
8372
|
+
|
|
8373
|
+ patientCourse := models.PatientDiseaseCourse{
|
|
8374
|
+ ID: id,
|
|
8375
|
+ OrgID: orgId,
|
|
8376
|
+ PatientID: patient_id,
|
|
8377
|
+ Recorder: admin_user_id,
|
|
8378
|
+ RecordTime: recordDate.Unix(),
|
|
8379
|
+ Content: content,
|
|
8380
|
+ Status: 1,
|
|
8381
|
+ CreateTime: time.Now().Unix(),
|
|
8382
|
+ ModifyTime: time.Now().Unix(),
|
|
8383
|
+ Title: "",
|
|
8384
|
+ }
|
|
8385
|
+
|
|
8386
|
+ service.CreateNewCourseOfDiaseaseRecord(patientCourse)
|
|
8387
|
+
|
|
8388
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8389
|
+ "msg": "ok",
|
|
8390
|
+ })
|
|
8391
|
+
|
|
8392
|
+}
|
|
8393
|
+
|
|
8394
|
+func (this *PatientApiController) GetPatientCoureseOfDiseasesList() {
|
|
8395
|
+
|
|
8396
|
+ patient_id, _ := this.GetInt64("patient_id")
|
|
8397
|
+ orgId := this.GetAdminUserInfo().CurrentOrgId
|
|
8398
|
+ list, _ := service.GetPatientCoureseOfDiseasesList(patient_id, orgId)
|
|
8399
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8400
|
+ "list": list,
|
|
8401
|
+ })
|
|
8402
|
+}
|
|
8403
|
+
|
|
8404
|
+func (this *PatientApiController) DeleteNewCourseOfDisease() {
|
|
8405
|
+
|
|
8406
|
+ id, _ := this.GetInt64("id")
|
|
8407
|
+
|
|
8408
|
+ service.DeleteNewCourseOfDisease(id)
|
|
8409
|
+
|
|
8410
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8411
|
+ "msg": "ok",
|
|
8412
|
+ })
|
|
8413
|
+}
|
|
8414
|
+
|
|
8415
|
+func (this *PatientApiController) CreateNewCourseTemplate() {
|
|
8416
|
+
|
|
8417
|
+ dataBody := make(map[string]interface{}, 0)
|
|
8418
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
8419
|
+ if err != nil {
|
|
8420
|
+ utils.ErrorLog(err.Error())
|
|
8421
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
8422
|
+ return
|
|
8423
|
+ }
|
|
8424
|
+
|
|
8425
|
+ title := dataBody["title"].(string)
|
|
8426
|
+
|
|
8427
|
+ content := dataBody["content"].(string)
|
|
8428
|
+
|
|
8429
|
+ orgId := this.GetAdminUserInfo().CurrentOrgId
|
|
8430
|
+
|
|
8431
|
+ courseTemplate := models.XtPatientCourseTemplate{
|
|
8432
|
+ Content: content,
|
|
8433
|
+ UserOrgId: orgId,
|
|
8434
|
+ Title: title,
|
|
8435
|
+ Status: 1,
|
|
8436
|
+ Ctime: time.Now().Unix(),
|
|
8437
|
+ Mtime: time.Now().Unix(),
|
|
8438
|
+ }
|
|
8439
|
+
|
|
8440
|
+ service.CreateCourseTemplate(courseTemplate)
|
|
8441
|
+
|
|
8442
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8443
|
+ "msg": "ok",
|
|
8444
|
+ })
|
|
8445
|
+}
|