|
@@ -168,6 +168,40 @@ func PatientApiRegistRouters() {
|
168
|
168
|
|
169
|
169
|
beego.Router("/api/patient/deletepatientdeathsummary", &DialysisApiController{}, "Get:DeletePatientDeathSummary")
|
170
|
170
|
|
|
171
|
+ beego.Router("/api/patient/createnewsickhistoryrecord", &PatientApiController{}, "Post:CreateNewSickHistoryRecord")
|
|
172
|
+
|
|
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")
|
|
192
|
+
|
|
193
|
+ beego.Router("/api/patient/savepatientdeathrecord", &PatientApiController{}, "Post:SavePatientDeathRecord")
|
|
194
|
+
|
|
195
|
+ beego.Router("/api/patient/getpatientdeathrecord", &PatientApiController{}, "Get:GetPatientDeathRecordOne")
|
|
196
|
+
|
|
197
|
+ beego.Router("/api/patient/savecouresetemplatetitle", &PatientApiController{}, "Post:SaveCoureseTemplateTitle")
|
|
198
|
+
|
|
199
|
+ beego.Router("/api/patient/getpatientcourseoftemplate", &PatientApiController{}, "Get:GetPatientCourseOfTemplate")
|
|
200
|
+
|
|
201
|
+ beego.Router("/api/patient/savecourseofnewtemplate", &PatientApiController{}, "Post:SaveCourseOfNewTemplate")
|
|
202
|
+
|
|
203
|
+ beego.Router("/api/patient/deletecourestempalte", &PatientApiController{}, "Get:DeleteCouseTemplate")
|
|
204
|
+
|
171
|
205
|
}
|
172
|
206
|
func (c *PatientApiController) GetExportList() {
|
173
|
207
|
startTime := c.GetString("start_time")
|
|
@@ -6331,68 +6365,31 @@ func (c *PatientApiController) ExportPatients() {
|
6331
|
6365
|
if patientNameM["id_card_no"] != nil || reflect.TypeOf(patientNameM["id_card_no"]).String() == "string" {
|
6332
|
6366
|
id_card_no, _ := patientNameM["id_card_no"].(string)
|
6333
|
6367
|
|
6334
|
|
- if IsIdCard(id_card_no) == false { //身份证号码不符合要求则生成一条导入错误日志
|
6335
|
|
-
|
6336
|
|
- if len(id_card_no) == 0 {
|
6337
|
|
- err_log := models.ExportErrLog{
|
6338
|
|
- LogType: 1,
|
6339
|
|
- UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
|
6340
|
|
- ErrMsg: "第" + strconv.Itoa(index+3) + "行" + "的身份证号码不能为空",
|
6341
|
|
- Status: 1,
|
6342
|
|
- CreateTime: time.Now().Unix(),
|
6343
|
|
- UpdateTime: time.Now().Unix(),
|
6344
|
|
- ExportTime: export_time,
|
6345
|
|
- }
|
6346
|
|
- service.CreateExportErrLog(&err_log)
|
6347
|
|
- continue
|
6348
|
|
-
|
6349
|
|
- } else {
|
6350
|
|
- err_log := models.ExportErrLog{
|
6351
|
|
- LogType: 1,
|
6352
|
|
- UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
|
6353
|
|
- ErrMsg: "第" + strconv.Itoa(index+3) + "行" + "的身份证号码格式不符合要求",
|
6354
|
|
- Status: 1,
|
6355
|
|
- CreateTime: time.Now().Unix(),
|
6356
|
|
- UpdateTime: time.Now().Unix(),
|
6357
|
|
- ExportTime: export_time,
|
6358
|
|
- }
|
6359
|
|
- service.CreateExportErrLog(&err_log)
|
6360
|
|
- continue
|
6361
|
|
-
|
|
6368
|
+ count := service.FindPatientIdCardNoIsExist(id_card_no, c.GetAdminUserInfo().CurrentOrgId)
|
|
6369
|
+ if count >= 1 {
|
|
6370
|
+ //if tempPatient != nil && tempPatient.ID > 0 {
|
|
6371
|
+ err_log := models.ExportErrLog{
|
|
6372
|
+ LogType: 1,
|
|
6373
|
+ UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
|
|
6374
|
+ ErrMsg: "第" + strconv.Itoa(index+3) + "行" + "的身份证号码在系统中已经存在",
|
|
6375
|
+ Status: 1,
|
|
6376
|
+ CreateTime: time.Now().Unix(),
|
|
6377
|
+ UpdateTime: time.Now().Unix(),
|
|
6378
|
+ ExportTime: export_time,
|
6362
|
6379
|
}
|
6363
|
|
-
|
|
6380
|
+ service.CreateExportErrLog(&err_log)
|
|
6381
|
+ continue
|
|
6382
|
+ }
|
|
6383
|
+ //}
|
|
6384
|
+ patient.IdCardNo = id_card_no
|
|
6385
|
+ //patient.Birthday = GetBirthDay(id_card_no).Unix()
|
|
6386
|
+ if GetBirthDay(id_card_no) == nil {
|
|
6387
|
+ patient.Birthday = 0
|
6364
|
6388
|
} else {
|
6365
|
|
- //var tempPatient *models.Patients
|
6366
|
|
- //for _, item := range all_patient {
|
6367
|
|
- // if item.IdCardNo == id_card_no {
|
6368
|
|
- // tempPatient = item
|
6369
|
|
- // }
|
6370
|
|
- //}
|
6371
|
|
- count := service.FindPatientIdCardNoIsExist(id_card_no, c.GetAdminUserInfo().CurrentOrgId)
|
6372
|
|
- if count >= 1 {
|
6373
|
|
- //if tempPatient != nil && tempPatient.ID > 0 {
|
6374
|
|
- err_log := models.ExportErrLog{
|
6375
|
|
- LogType: 1,
|
6376
|
|
- UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
|
6377
|
|
- ErrMsg: "第" + strconv.Itoa(index+3) + "行" + "的身份证号码在系统中已经存在",
|
6378
|
|
- Status: 1,
|
6379
|
|
- CreateTime: time.Now().Unix(),
|
6380
|
|
- UpdateTime: time.Now().Unix(),
|
6381
|
|
- ExportTime: export_time,
|
6382
|
|
- }
|
6383
|
|
- service.CreateExportErrLog(&err_log)
|
6384
|
|
- continue
|
6385
|
|
- }
|
6386
|
|
- //}
|
6387
|
|
- patient.IdCardNo = id_card_no
|
6388
|
|
- //patient.Birthday = GetBirthDay(id_card_no).Unix()
|
6389
|
|
- if GetBirthDay(id_card_no) == nil {
|
6390
|
|
- patient.Birthday = 0
|
6391
|
|
- } else {
|
6392
|
|
- patient.Birthday = GetBirthDay(id_card_no).Unix()
|
|
6389
|
+ patient.Birthday = GetBirthDay(id_card_no).Unix()
|
6393
|
6390
|
|
6394
|
|
- }
|
6395
|
6391
|
}
|
|
6392
|
+
|
6396
|
6393
|
}
|
6397
|
6394
|
|
6398
|
6395
|
fmt.Println("111112222")
|
|
@@ -8159,3 +8156,373 @@ func (c *DialysisApiController) DeletePatientDeathSummary() {
|
8159
|
8156
|
"msg": "删除成功",
|
8160
|
8157
|
})
|
8161
|
8158
|
}
|
|
8159
|
+
|
|
8160
|
+func (this *PatientApiController) CreateNewSickHistoryRecord() {
|
|
8161
|
+
|
|
8162
|
+ dataBody := make(map[string]interface{}, 0)
|
|
8163
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
8164
|
+ if err != nil {
|
|
8165
|
+ utils.ErrorLog(err.Error())
|
|
8166
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
8167
|
+ return
|
|
8168
|
+ }
|
|
8169
|
+
|
|
8170
|
+ record_date := dataBody["record_time"].(string)
|
|
8171
|
+ timeLayout := "2006-01-02"
|
|
8172
|
+ loc, _ := time.LoadLocation("Local")
|
|
8173
|
+ var recordDate int64
|
|
8174
|
+ if len(record_date) > 0 {
|
|
8175
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
|
|
8176
|
+ if err != nil {
|
|
8177
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
8178
|
+ return
|
|
8179
|
+ }
|
|
8180
|
+ recordDate = theTime.Unix()
|
|
8181
|
+ }
|
|
8182
|
+
|
|
8183
|
+ id := int64(dataBody["id"].(float64))
|
|
8184
|
+
|
|
8185
|
+ patient_id := int64(dataBody["patient_id"].(float64))
|
|
8186
|
+
|
|
8187
|
+ doctor_id := int64(dataBody["doctor_id"].(float64))
|
|
8188
|
+
|
|
8189
|
+ guominyaowu_desc := dataBody["guominyaowu_desc"].(string)
|
|
8190
|
+
|
|
8191
|
+ is_fumotouxishi := int64(dataBody["is_fumotouxishi"].(float64))
|
|
8192
|
+
|
|
8193
|
+ is_guominyaowu := int64(dataBody["is_guominyaowu"].(float64))
|
|
8194
|
+
|
|
8195
|
+ is_shenyizhishi := int64(dataBody["is_shenyizhishi"].(float64))
|
|
8196
|
+
|
|
8197
|
+ content := dataBody["content"].(string)
|
|
8198
|
+
|
|
8199
|
+ orgId := this.GetAdminUserInfo().CurrentOrgId
|
|
8200
|
+
|
|
8201
|
+ patientSickHistory := models.XtPatientSickHistory{
|
|
8202
|
+ ID: id,
|
|
8203
|
+ OrgId: orgId,
|
|
8204
|
+ PatientId: patient_id,
|
|
8205
|
+ Recorder: 0,
|
|
8206
|
+ RecordTime: recordDate,
|
|
8207
|
+ RecordDate: recordDate,
|
|
8208
|
+ Content: content,
|
|
8209
|
+ Status: 1,
|
|
8210
|
+ Ctime: time.Now().Unix(),
|
|
8211
|
+ Mtime: time.Now().Unix(),
|
|
8212
|
+ Title: "",
|
|
8213
|
+ IsShenyizhiHistory: is_shenyizhishi,
|
|
8214
|
+ IsFumoDialysisHistory: is_fumotouxishi,
|
|
8215
|
+ HypersusceptibilityDesc: guominyaowu_desc,
|
|
8216
|
+ DoctorId: doctor_id,
|
|
8217
|
+ IsHypersusceptibility: is_guominyaowu,
|
|
8218
|
+ }
|
|
8219
|
+
|
|
8220
|
+ service.CreateNewSickHistoryRecord(patientSickHistory)
|
|
8221
|
+
|
|
8222
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8223
|
+ "patientSickHistory": patientSickHistory,
|
|
8224
|
+ })
|
|
8225
|
+}
|
|
8226
|
+
|
|
8227
|
+func (this *PatientApiController) GetNewSickHistory() {
|
|
8228
|
+
|
|
8229
|
+ patient_id, _ := this.GetInt64("patient_id")
|
|
8230
|
+
|
|
8231
|
+ orgId := this.GetAdminUserInfo().CurrentOrgId
|
|
8232
|
+
|
|
8233
|
+ list, _ := service.GetNewSickHistory(patient_id, orgId)
|
|
8234
|
+
|
|
8235
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8236
|
+ "list": list,
|
|
8237
|
+ })
|
|
8238
|
+}
|
|
8239
|
+
|
|
8240
|
+func (this *PatientApiController) DeleteNewSickHistory() {
|
|
8241
|
+
|
|
8242
|
+ id, _ := this.GetInt64("id")
|
|
8243
|
+
|
|
8244
|
+ service.DeleteNewSickHistory(id)
|
|
8245
|
+
|
|
8246
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8247
|
+ "msg": "ok",
|
|
8248
|
+ })
|
|
8249
|
+}
|
|
8250
|
+
|
|
8251
|
+func (this *PatientApiController) SaveSickHistoryTemplate() {
|
|
8252
|
+
|
|
8253
|
+ dataBody := make(map[string]interface{}, 0)
|
|
8254
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
8255
|
+ if err != nil {
|
|
8256
|
+ utils.ErrorLog(err.Error())
|
|
8257
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
8258
|
+ return
|
|
8259
|
+ }
|
|
8260
|
+
|
|
8261
|
+ title := dataBody["title"].(string)
|
|
8262
|
+
|
|
8263
|
+ content := dataBody["content"].(string)
|
|
8264
|
+
|
|
8265
|
+ orgId := this.GetAdminUserInfo().CurrentOrgId
|
|
8266
|
+
|
|
8267
|
+ sickHistoryTemplate := models.XtSickHistoryTemplate{
|
|
8268
|
+ Content: content,
|
|
8269
|
+ UserOrgId: orgId,
|
|
8270
|
+ Title: title,
|
|
8271
|
+ Ctime: time.Now().Unix(),
|
|
8272
|
+ Mtime: time.Now().Unix(),
|
|
8273
|
+ Status: 1,
|
|
8274
|
+ }
|
|
8275
|
+
|
|
8276
|
+ service.CreateSickHistoryTemplate(sickHistoryTemplate)
|
|
8277
|
+
|
|
8278
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8279
|
+ "sickHistoryTemplate": "sickHistoryTemplate",
|
|
8280
|
+ })
|
|
8281
|
+}
|
|
8282
|
+
|
|
8283
|
+func (this *PatientApiController) GetSickHistoryTemplate() {
|
|
8284
|
+
|
|
8285
|
+ orgId := this.GetAdminUserInfo().CurrentOrgId
|
|
8286
|
+
|
|
8287
|
+ templateList, _ := service.GetSickHistoryTemplate(orgId)
|
|
8288
|
+
|
|
8289
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8290
|
+ "templateList": templateList,
|
|
8291
|
+ })
|
|
8292
|
+}
|
|
8293
|
+
|
|
8294
|
+func (this *PatientApiController) ModifySickHistoryTemplate() {
|
|
8295
|
+
|
|
8296
|
+ dataBody := make(map[string]interface{}, 0)
|
|
8297
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
8298
|
+ if err != nil {
|
|
8299
|
+ utils.ErrorLog(err.Error())
|
|
8300
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
8301
|
+ return
|
|
8302
|
+ }
|
|
8303
|
+
|
|
8304
|
+ template_id := int64(dataBody["template_id"].(float64))
|
|
8305
|
+ content := dataBody["content"].(string)
|
|
8306
|
+
|
|
8307
|
+ service.ModifySickHistoryTemplate(template_id, content)
|
|
8308
|
+
|
|
8309
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8310
|
+ "msg": "ok",
|
|
8311
|
+ })
|
|
8312
|
+}
|
|
8313
|
+
|
|
8314
|
+func (this *PatientApiController) DeleteSickHistoryTemplate() {
|
|
8315
|
+
|
|
8316
|
+ template_id, _ := this.GetInt64("template_id")
|
|
8317
|
+
|
|
8318
|
+ service.DeleteSickHistoryTemplate(template_id)
|
|
8319
|
+
|
|
8320
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8321
|
+ "msg": "ok",
|
|
8322
|
+ })
|
|
8323
|
+}
|
|
8324
|
+
|
|
8325
|
+func (this *PatientApiController) CreateNewCourseOfDiaseaseRecord() {
|
|
8326
|
+
|
|
8327
|
+ dataBody := make(map[string]interface{}, 0)
|
|
8328
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
8329
|
+ if err != nil {
|
|
8330
|
+ utils.ErrorLog(err.Error())
|
|
8331
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
8332
|
+ return
|
|
8333
|
+ }
|
|
8334
|
+
|
|
8335
|
+ patient_id := int64(dataBody["patient_id"].(float64))
|
|
8336
|
+
|
|
8337
|
+ record_date := dataBody["record_date"].(string)
|
|
8338
|
+
|
|
8339
|
+ id := int64(dataBody["id"].(float64))
|
|
8340
|
+
|
|
8341
|
+ recordDate, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", record_date)
|
|
8342
|
+
|
|
8343
|
+ content := dataBody["content"].(string)
|
|
8344
|
+ admin_user_id := int64(dataBody["admin_user_id"].(float64))
|
|
8345
|
+
|
|
8346
|
+ orgId := this.GetAdminUserInfo().CurrentOrgId
|
|
8347
|
+
|
|
8348
|
+ patientCourse := models.PatientDiseaseCourse{
|
|
8349
|
+ ID: id,
|
|
8350
|
+ OrgID: orgId,
|
|
8351
|
+ PatientID: patient_id,
|
|
8352
|
+ Recorder: admin_user_id,
|
|
8353
|
+ RecordTime: recordDate.Unix(),
|
|
8354
|
+ Content: content,
|
|
8355
|
+ Status: 1,
|
|
8356
|
+ CreateTime: time.Now().Unix(),
|
|
8357
|
+ ModifyTime: time.Now().Unix(),
|
|
8358
|
+ Title: "",
|
|
8359
|
+ }
|
|
8360
|
+
|
|
8361
|
+ service.CreateNewCourseOfDiaseaseRecord(patientCourse)
|
|
8362
|
+
|
|
8363
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8364
|
+ "msg": "ok",
|
|
8365
|
+ })
|
|
8366
|
+
|
|
8367
|
+}
|
|
8368
|
+
|
|
8369
|
+func (this *PatientApiController) GetPatientCoureseOfDiseasesList() {
|
|
8370
|
+
|
|
8371
|
+ patient_id, _ := this.GetInt64("patient_id")
|
|
8372
|
+ orgId := this.GetAdminUserInfo().CurrentOrgId
|
|
8373
|
+ list, _ := service.GetPatientCoureseOfDiseasesList(patient_id, orgId)
|
|
8374
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8375
|
+ "list": list,
|
|
8376
|
+ })
|
|
8377
|
+}
|
|
8378
|
+
|
|
8379
|
+func (this *PatientApiController) DeleteNewCourseOfDisease() {
|
|
8380
|
+
|
|
8381
|
+ id, _ := this.GetInt64("id")
|
|
8382
|
+
|
|
8383
|
+ service.DeleteNewCourseOfDisease(id)
|
|
8384
|
+
|
|
8385
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8386
|
+ "msg": "ok",
|
|
8387
|
+ })
|
|
8388
|
+}
|
|
8389
|
+
|
|
8390
|
+func (this *PatientApiController) CreateNewCourseTemplate() {
|
|
8391
|
+
|
|
8392
|
+ dataBody := make(map[string]interface{}, 0)
|
|
8393
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
8394
|
+ if err != nil {
|
|
8395
|
+ utils.ErrorLog(err.Error())
|
|
8396
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
8397
|
+ return
|
|
8398
|
+ }
|
|
8399
|
+
|
|
8400
|
+ title := dataBody["title"].(string)
|
|
8401
|
+
|
|
8402
|
+ content := dataBody["content"].(string)
|
|
8403
|
+
|
|
8404
|
+ orgId := this.GetAdminUserInfo().CurrentOrgId
|
|
8405
|
+
|
|
8406
|
+ courseTemplate := models.XtPatientCourseTemplate{
|
|
8407
|
+ Content: content,
|
|
8408
|
+ UserOrgId: orgId,
|
|
8409
|
+ Title: title,
|
|
8410
|
+ Status: 1,
|
|
8411
|
+ Ctime: time.Now().Unix(),
|
|
8412
|
+ Mtime: time.Now().Unix(),
|
|
8413
|
+ }
|
|
8414
|
+
|
|
8415
|
+ service.CreateCourseTemplate(courseTemplate)
|
|
8416
|
+
|
|
8417
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8418
|
+ "msg": "ok",
|
|
8419
|
+ })
|
|
8420
|
+}
|
|
8421
|
+
|
|
8422
|
+func (this *PatientApiController) SavePatientDeathRecord() {
|
|
8423
|
+
|
|
8424
|
+ orgId := this.GetAdminUserInfo().CurrentOrgId
|
|
8425
|
+ dataBody := make(map[string]interface{}, 0)
|
|
8426
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
8427
|
+ fmt.Println("err", err)
|
|
8428
|
+ content := dataBody["content"].(string)
|
|
8429
|
+
|
|
8430
|
+ dialyszerinformedPrint := models.XtDeathRecord{
|
|
8431
|
+ UserOrgId: orgId,
|
|
8432
|
+ Content: content,
|
|
8433
|
+ Status: 1,
|
|
8434
|
+ Ctime: time.Now().Unix(),
|
|
8435
|
+ Mtime: time.Now().Unix(),
|
|
8436
|
+ }
|
|
8437
|
+
|
|
8438
|
+ informed, _ := service.GetPatientDeathRecord(orgId)
|
|
8439
|
+
|
|
8440
|
+ if informed.ID == 0 {
|
|
8441
|
+
|
|
8442
|
+ service.CreatePatientDeathRecord(dialyszerinformedPrint)
|
|
8443
|
+ }
|
|
8444
|
+
|
|
8445
|
+ if informed.ID > 0 {
|
|
8446
|
+ service.UpdatePatientDeathRecord(informed.ID, content)
|
|
8447
|
+ }
|
|
8448
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8449
|
+ "list": dialyszerinformedPrint,
|
|
8450
|
+ })
|
|
8451
|
+}
|
|
8452
|
+
|
|
8453
|
+func (this *PatientApiController) GetPatientDeathRecordOne() {
|
|
8454
|
+
|
|
8455
|
+ orgId := this.GetAdminUserInfo().CurrentOrgId
|
|
8456
|
+
|
|
8457
|
+ record, _ := service.GetPatientDeathRecordList(orgId)
|
|
8458
|
+
|
|
8459
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8460
|
+ "record": record,
|
|
8461
|
+ })
|
|
8462
|
+}
|
|
8463
|
+
|
|
8464
|
+func (this *PatientApiController) SaveCoureseTemplateTitle() {
|
|
8465
|
+
|
|
8466
|
+ orgId := this.GetAdminUserInfo().CurrentOrgId
|
|
8467
|
+ dataBody := make(map[string]interface{}, 0)
|
|
8468
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
8469
|
+ fmt.Println("err", err)
|
|
8470
|
+ title := dataBody["title"].(string)
|
|
8471
|
+ content := dataBody["content"].(string)
|
|
8472
|
+
|
|
8473
|
+ courseTemplate := models.XtPatientCourseTemplate{
|
|
8474
|
+ Content: content,
|
|
8475
|
+ UserOrgId: orgId,
|
|
8476
|
+ Title: title,
|
|
8477
|
+ Status: 1,
|
|
8478
|
+ Ctime: time.Now().Unix(),
|
|
8479
|
+ Mtime: time.Now().Unix(),
|
|
8480
|
+ }
|
|
8481
|
+
|
|
8482
|
+ service.SaveCoureseTemplateTitle(courseTemplate)
|
|
8483
|
+
|
|
8484
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8485
|
+ "courseTemplate": courseTemplate,
|
|
8486
|
+ })
|
|
8487
|
+
|
|
8488
|
+}
|
|
8489
|
+
|
|
8490
|
+func (this *PatientApiController) GetPatientCourseOfTemplate() {
|
|
8491
|
+
|
|
8492
|
+ orgId := this.GetAdminUserInfo().CurrentOrgId
|
|
8493
|
+
|
|
8494
|
+ list, _ := service.GetPatientCourseOfTemplate(orgId)
|
|
8495
|
+
|
|
8496
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8497
|
+ "templateList": list,
|
|
8498
|
+ })
|
|
8499
|
+}
|
|
8500
|
+
|
|
8501
|
+func (this *PatientApiController) SaveCourseOfNewTemplate() {
|
|
8502
|
+
|
|
8503
|
+ dataBody := make(map[string]interface{}, 0)
|
|
8504
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
8505
|
+ fmt.Println("err", err)
|
|
8506
|
+ id := int64(dataBody["template_id"].(float64))
|
|
8507
|
+ content := dataBody["content"].(string)
|
|
8508
|
+
|
|
8509
|
+ service.SaveCourseOfNewTemplate(id, content)
|
|
8510
|
+
|
|
8511
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8512
|
+ "msg": "ok",
|
|
8513
|
+ })
|
|
8514
|
+
|
|
8515
|
+}
|
|
8516
|
+
|
|
8517
|
+func (this *PatientApiController) DeleteCouseTemplate() {
|
|
8518
|
+
|
|
8519
|
+ id, _ := this.GetInt64("id")
|
|
8520
|
+
|
|
8521
|
+ fmt.Println("id==================", id)
|
|
8522
|
+ service.DeleteCouseTemplate(id)
|
|
8523
|
+
|
|
8524
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8525
|
+ "msg": "ok",
|
|
8526
|
+ })
|
|
8527
|
+
|
|
8528
|
+}
|