|
@@ -187,13 +187,20 @@ func (this *NewDialysisApiController) SavePatient() {
|
187
|
187
|
ids = append(ids, id)
|
188
|
188
|
}
|
189
|
189
|
fmt.Print("传染病2", contagions)
|
|
190
|
+ is_infectious := int64(dataBody["is_infectious"].(float64))
|
|
191
|
+ fmt.Print("传染病", is_infectious)
|
190
|
192
|
adminssionNumber := dataBody["admissionNumber"].(string)
|
191
|
193
|
fmt.Print("住院号", adminssionNumber)
|
|
194
|
+
|
192
|
195
|
fistdate := dataBody["fistDate"].(string)
|
193
|
196
|
fmt.Print("首次透析日期", fistdate)
|
194
|
|
- times, err := utils.ParseTimeStringToTime(timeLayout, fistdate+"00:00:00")
|
|
197
|
+ timeLayouts := "2006-01-02"
|
|
198
|
+ loc, _ := time.LoadLocation("Local")
|
|
199
|
+ times, err := time.ParseInLocation(timeLayouts+" 15:04:05", fistdate+" 00:00:00", loc)
|
|
200
|
+ //times, err := utils.ParseTimeStringToTime(timeLayout, fistdate+"00:00:00")
|
195
|
201
|
fisttime := times.Unix()
|
196
|
202
|
fmt.Print(fisttime)
|
|
203
|
+
|
197
|
204
|
diagonse := dataBody["diagnose"].(string)
|
198
|
205
|
fmt.Print("诊断", diagonse)
|
199
|
206
|
avatar := dataBody["avatar"].(string)
|
|
@@ -225,9 +232,10 @@ func (this *NewDialysisApiController) SavePatient() {
|
225
|
232
|
//会员
|
226
|
233
|
memberFistDate := dataBody["memberFistDate"].(string)
|
227
|
234
|
fmt.Print("首次透析日期", memberFistDate)
|
228
|
|
- membertimes, err := utils.ParseTimeStringToTime(timeLayout, memberFistDate+"00:00:00")
|
|
235
|
+ //membertimes, err := utils.ParseTimeStringToTime(timeLayout, memberFistDate+"00:00:00")
|
|
236
|
+ membertimes, _ := time.ParseInLocation(timeLayouts+" 15:04:05", memberFistDate+" 00:00:00", loc)
|
229
|
237
|
memtime := membertimes.Unix()
|
230
|
|
- fmt.Print(memtime)
|
|
238
|
+ fmt.Print("会员透析日期", memtime)
|
231
|
239
|
patient_type := int64(dataBody["patientType"].(float64))
|
232
|
240
|
fmt.Print("病种", patient_type)
|
233
|
241
|
treatmentmethod := int64(dataBody["treatmentMethod"].(float64))
|
|
@@ -254,6 +262,7 @@ func (this *NewDialysisApiController) SavePatient() {
|
254
|
262
|
CreatedTime: time.Now().Unix(),
|
255
|
263
|
Avatar: avatar,
|
256
|
264
|
IdCardNo: idCard,
|
|
265
|
+ IsInfectious: is_infectious,
|
257
|
266
|
}
|
258
|
267
|
err := service.CreateOldPatient(&patients)
|
259
|
268
|
fmt.Print("报错", err)
|
|
@@ -282,6 +291,8 @@ func (this *NewDialysisApiController) SavePatient() {
|
282
|
291
|
BloodPatients: bloodPatient,
|
283
|
292
|
SlowPatients: slowpatient,
|
284
|
293
|
BloodId: patient.ID,
|
|
294
|
+ IsInfectious: is_infectious,
|
|
295
|
+ IdCardNo: idCard,
|
285
|
296
|
}
|
286
|
297
|
err = service.CreateNewPatient(&patientsNew)
|
287
|
298
|
fmt.Print("报错", err)
|
|
@@ -300,7 +311,7 @@ func (this *NewDialysisApiController) SavePatient() {
|
300
|
311
|
}
|
301
|
312
|
}
|
302
|
313
|
|
303
|
|
- fmt.Print("slowpatient----------------", slowpatient)
|
|
314
|
+ fmt.Print("slowpatient", slowpatient)
|
304
|
315
|
//如果是慢病病人
|
305
|
316
|
if slowpatient == 1 {
|
306
|
317
|
_, errcodetwo := service.GetSlowPatientData(phone, orgid)
|
|
@@ -349,6 +360,9 @@ func (this *NewDialysisApiController) SavePatient() {
|
349
|
360
|
BloodPatients: bloodPatient,
|
350
|
361
|
SlowPatients: slowpatient,
|
351
|
362
|
SlowId: slowPatient.ID,
|
|
363
|
+ IsInfectious: is_infectious,
|
|
364
|
+ IdCardNo: idCard,
|
|
365
|
+ EquitmentId: requipmentId,
|
352
|
366
|
}
|
353
|
367
|
err = service.CreateNewPatient(&patientsNew)
|
354
|
368
|
if err != nil {
|
|
@@ -404,6 +418,11 @@ func (this *NewDialysisApiController) SavePatient() {
|
404
|
418
|
BloodPatients: bloodPatient,
|
405
|
419
|
SlowPatients: slowpatient,
|
406
|
420
|
MemberId: memberPatient.ID,
|
|
421
|
+ IsInfectious: is_infectious,
|
|
422
|
+ IdCardNo: idCard,
|
|
423
|
+ MemberFistdate: memtime,
|
|
424
|
+ MemberPatienttype: patient_type,
|
|
425
|
+ MemberTreatement: treatmentmethod,
|
407
|
426
|
}
|
408
|
427
|
err = service.CreateNewPatient(&patientsNew)
|
409
|
428
|
fmt.Print("报错-----------------------", err)
|
|
@@ -485,6 +504,11 @@ func (this *NewDialysisApiController) SavePatient() {
|
485
|
504
|
BloodPatients: bloodPatient,
|
486
|
505
|
SlowPatients: slowpatient,
|
487
|
506
|
MemberId: memberPatient.ID,
|
|
507
|
+ IsInfectious: is_infectious,
|
|
508
|
+ IdCardNo: idCard,
|
|
509
|
+ MemberFistdate: memtime,
|
|
510
|
+ MemberPatienttype: patient_type,
|
|
511
|
+ MemberTreatement: treatmentmethod,
|
488
|
512
|
}
|
489
|
513
|
err = service.CreateNewPatient(&patientsNew)
|
490
|
514
|
fmt.Print("报错-----------------------", err)
|
|
@@ -517,14 +541,20 @@ func (this *NewDialysisApiController) GetPatientDetail() {
|
517
|
541
|
detail, err := service.GetPatientDetailTwo(id)
|
518
|
542
|
//获取传染病详情
|
519
|
543
|
diseases := service.GetPatientDiseasesTwo(detail.BloodId)
|
|
544
|
+ //获取慢病传染病
|
|
545
|
+ slowDiseases, err := service.GetSlowPatientDiseases(detail.SlowId)
|
|
546
|
+ //获取慢病慢性病
|
|
547
|
+ cronicDiseases, err := service.GetCronicDiseases(detail.SlowId)
|
520
|
548
|
//获取血透医嘱管理
|
521
|
549
|
if err != nil {
|
522
|
550
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
523
|
551
|
return
|
524
|
552
|
}
|
525
|
553
|
this.ServeSuccessJSON(map[string]interface{}{
|
526
|
|
- "patientDetail": detail,
|
527
|
|
- "diseases": diseases,
|
|
554
|
+ "patientDetail": detail,
|
|
555
|
+ "diseases": diseases,
|
|
556
|
+ "slowDiseases": slowDiseases,
|
|
557
|
+ "cronicDiseases": cronicDiseases,
|
528
|
558
|
})
|
529
|
559
|
}
|
530
|
560
|
|