|
@@ -62,6 +62,7 @@ func PatientApiRegistRouters() {
|
62
|
62
|
beego.Router("/api/infectious/remind", &PatientApiController{}, "Get:GetRemindPatientList")
|
63
|
63
|
|
64
|
64
|
beego.Router("/api/remind/is_open", &PatientApiController{}, "Post:PostIsOpenRemind")
|
|
65
|
+ beego.Router("/api/patients/advices/getpatientschedules", &PatientApiController{}, "Get:GetPatientScheduleOne")
|
65
|
66
|
|
66
|
67
|
}
|
67
|
68
|
|
|
@@ -243,29 +244,29 @@ func (c *PatientApiController) CreatePatient() {
|
243
|
244
|
//获取老表的最后一条数据
|
244
|
245
|
patients, err := service.GetLastPatientData(adminUserInfo.CurrentOrgId)
|
245
|
246
|
patientsNew := models.XtPatientsNew{
|
246
|
|
- UserOrgId: adminUserInfo.CurrentOrgId,
|
247
|
|
- UserId: 0,
|
248
|
|
- Avatar: patients.Avatar,
|
249
|
|
- PatientType: patients.PatientType,
|
250
|
|
- DialysisNo: patients.DialysisNo,
|
251
|
|
- AdmissionNumber: patients.AdmissionNumber,
|
252
|
|
- Source: patients.Source,
|
253
|
|
- Lapseto: patients.Lapseto,
|
254
|
|
- PartitionId: patients.PartitionId,
|
255
|
|
- BedId: patients.BedId,
|
256
|
|
- Name: patients.Name,
|
257
|
|
- Alias: patients.Alias,
|
258
|
|
- Gender: patients.Gender,
|
259
|
|
- MaritalStatus: patients.MaritalStatus,
|
260
|
|
- IdCardNo: patients.IdCardNo,
|
261
|
|
- Birthday: patients.Birthday,
|
262
|
|
- ReimbursementWayId: patients.ReimbursementWayId,
|
263
|
|
- HealthCareType: patients.HealthCareType,
|
264
|
|
- HealthCareNo: patients.HealthCareNo,
|
265
|
|
- HealthCareDueDate: patients.HealthCareDueDate,
|
266
|
|
- Height: patients.Height,
|
267
|
|
- BloodType: patients.BloodType,
|
268
|
|
- Rh: patients.Rh,
|
|
247
|
+ UserOrgId: adminUserInfo.CurrentOrgId,
|
|
248
|
+ UserId: 0,
|
|
249
|
+ Avatar: patients.Avatar,
|
|
250
|
+ PatientType: patients.PatientType,
|
|
251
|
+ DialysisNo: patients.DialysisNo,
|
|
252
|
+ AdmissionNumber: patients.AdmissionNumber,
|
|
253
|
+ Source: patients.Source,
|
|
254
|
+ Lapseto: patients.Lapseto,
|
|
255
|
+ PartitionId: patients.PartitionId,
|
|
256
|
+ BedId: patients.BedId,
|
|
257
|
+ Name: patients.Name,
|
|
258
|
+ Alias: patients.Alias,
|
|
259
|
+ Gender: patients.Gender,
|
|
260
|
+ MaritalStatus: patients.MaritalStatus,
|
|
261
|
+ IdCardNo: patients.IdCardNo,
|
|
262
|
+ Birthday: patients.Birthday,
|
|
263
|
+ ReimbursementWayId: patients.ReimbursementWayId,
|
|
264
|
+ HealthCareType: patients.HealthCareType,
|
|
265
|
+ HealthCareNo: patients.HealthCareNo,
|
|
266
|
+ HealthCareDueDate: patients.HealthCareDueDate,
|
|
267
|
+ Height: patients.Height,
|
|
268
|
+ BloodType: patients.BloodType,
|
|
269
|
+ Rh: patients.Rh,
|
269
|
270
|
HealthCareDueAlertDate: patients.HealthCareDueAlertDate,
|
270
|
271
|
EducationLevel: patients.EducationLevel,
|
271
|
272
|
Profession: patients.Profession,
|
|
@@ -311,27 +312,27 @@ func (c *PatientApiController) CreatePatient() {
|
311
|
312
|
Nation: patients.Nation,
|
312
|
313
|
NativePlace: patients.NativePlace,
|
313
|
314
|
Age: patients.Age,
|
314
|
|
- InfectiousNextRecordTime: patients.InfectiousNextRecordTime,
|
315
|
|
- IsInfectious: patients.IsInfectious,
|
316
|
|
- RemindCycle: patients.RemindCycle,
|
317
|
|
- ResponseResult: patients.ResponseResult,
|
318
|
|
- IsOpenRemind: patients.IsOpenRemind,
|
319
|
|
- FirstTreatmentDate: patients.FirstTreatmentDate,
|
320
|
|
- DialysisAge: patients.DialysisAge,
|
321
|
|
- ExpenseKind: patients.ExpenseKind,
|
322
|
|
- TellPhone: patients.TellPhone,
|
323
|
|
- ContactName: patients.ContactName,
|
324
|
|
- BloodPatients: 1,
|
325
|
|
- SlowPatients: 0,
|
326
|
|
- MemberPatients: 0,
|
327
|
|
- EcommerPatients: "",
|
328
|
|
- BloodId: patients.ID,
|
329
|
|
- SlowId: 0,
|
330
|
|
- MemberId: 0,
|
331
|
|
- MemberFistdate: 0,
|
332
|
|
- MemberPatienttype: 0,
|
333
|
|
- MemberTreatement: 0,
|
334
|
|
- EquitmentId: "",
|
|
315
|
+ InfectiousNextRecordTime: patients.InfectiousNextRecordTime,
|
|
316
|
+ IsInfectious: patients.IsInfectious,
|
|
317
|
+ RemindCycle: patients.RemindCycle,
|
|
318
|
+ ResponseResult: patients.ResponseResult,
|
|
319
|
+ IsOpenRemind: patients.IsOpenRemind,
|
|
320
|
+ FirstTreatmentDate: patients.FirstTreatmentDate,
|
|
321
|
+ DialysisAge: patients.DialysisAge,
|
|
322
|
+ ExpenseKind: patients.ExpenseKind,
|
|
323
|
+ TellPhone: patients.TellPhone,
|
|
324
|
+ ContactName: patients.ContactName,
|
|
325
|
+ BloodPatients: 1,
|
|
326
|
+ SlowPatients: 0,
|
|
327
|
+ MemberPatients: 0,
|
|
328
|
+ EcommerPatients: "",
|
|
329
|
+ BloodId: patients.ID,
|
|
330
|
+ SlowId: 0,
|
|
331
|
+ MemberId: 0,
|
|
332
|
+ MemberFistdate: 0,
|
|
333
|
+ MemberPatienttype: 0,
|
|
334
|
+ MemberTreatement: 0,
|
|
335
|
+ EquitmentId: "",
|
335
|
336
|
}
|
336
|
337
|
|
337
|
338
|
err = service.CreatePatientsNew(&patientsNew)
|
|
@@ -459,29 +460,29 @@ func (c *PatientApiController) EditPatient() {
|
459
|
460
|
}
|
460
|
461
|
fmt.Println("病人--------------------------------------------------------------", patient.Name, patient.Age)
|
461
|
462
|
patientsNew := models.XtPatientsNew{
|
462
|
|
- UserOrgId: patient.UserOrgId,
|
463
|
|
- UserId: patient.UserId,
|
464
|
|
- Avatar: patient.Avatar,
|
465
|
|
- PatientType: patient.PatientType,
|
466
|
|
- DialysisNo: patient.DialysisNo,
|
467
|
|
- AdmissionNumber: patient.AdmissionNumber,
|
468
|
|
- Source: patient.Source,
|
469
|
|
- Lapseto: patient.Lapseto,
|
470
|
|
- PartitionId: patient.PartitionId,
|
471
|
|
- BedId: patient.BedId,
|
472
|
|
- Name: patient.Name,
|
473
|
|
- Alias: patient.Alias,
|
474
|
|
- Gender: patient.Gender,
|
475
|
|
- MaritalStatus: patient.MaritalStatus,
|
476
|
|
- IdCardNo: patient.IdCardNo,
|
477
|
|
- Birthday: patient.Birthday,
|
478
|
|
- ReimbursementWayId: patient.ReimbursementWayId,
|
479
|
|
- HealthCareType: patient.HealthCareType,
|
480
|
|
- HealthCareNo: patient.HealthCareNo,
|
481
|
|
- HealthCareDueDate: patient.HealthCareDueDate,
|
482
|
|
- Height: patient.Height,
|
483
|
|
- BloodType: patient.BloodType,
|
484
|
|
- Rh: patient.Rh,
|
|
463
|
+ UserOrgId: patient.UserOrgId,
|
|
464
|
+ UserId: patient.UserId,
|
|
465
|
+ Avatar: patient.Avatar,
|
|
466
|
+ PatientType: patient.PatientType,
|
|
467
|
+ DialysisNo: patient.DialysisNo,
|
|
468
|
+ AdmissionNumber: patient.AdmissionNumber,
|
|
469
|
+ Source: patient.Source,
|
|
470
|
+ Lapseto: patient.Lapseto,
|
|
471
|
+ PartitionId: patient.PartitionId,
|
|
472
|
+ BedId: patient.BedId,
|
|
473
|
+ Name: patient.Name,
|
|
474
|
+ Alias: patient.Alias,
|
|
475
|
+ Gender: patient.Gender,
|
|
476
|
+ MaritalStatus: patient.MaritalStatus,
|
|
477
|
+ IdCardNo: patient.IdCardNo,
|
|
478
|
+ Birthday: patient.Birthday,
|
|
479
|
+ ReimbursementWayId: patient.ReimbursementWayId,
|
|
480
|
+ HealthCareType: patient.HealthCareType,
|
|
481
|
+ HealthCareNo: patient.HealthCareNo,
|
|
482
|
+ HealthCareDueDate: patient.HealthCareDueDate,
|
|
483
|
+ Height: patient.Height,
|
|
484
|
+ BloodType: patient.BloodType,
|
|
485
|
+ Rh: patient.Rh,
|
485
|
486
|
HealthCareDueAlertDate: patient.HealthCareDueAlertDate,
|
486
|
487
|
EducationLevel: patient.EducationLevel,
|
487
|
488
|
Profession: patient.Profession,
|
|
@@ -523,17 +524,17 @@ func (c *PatientApiController) EditPatient() {
|
523
|
524
|
Nation: patient.Nation,
|
524
|
525
|
NativePlace: patient.NativePlace,
|
525
|
526
|
Age: patient.Age,
|
526
|
|
- InfectiousNextRecordTime: patient.InfectiousNextRecordTime,
|
527
|
|
- IsInfectious: patient.IsInfectious,
|
528
|
|
- RemindCycle: patient.RemindCycle,
|
529
|
|
- ResponseResult: patient.ResponseResult,
|
530
|
|
- IsOpenRemind: patient.IsOpenRemind,
|
531
|
|
- FirstTreatmentDate: patient.FirstTreatmentDate,
|
532
|
|
- DialysisAge: patient.DialysisAge,
|
533
|
|
- ExpenseKind: patient.ExpenseKind,
|
534
|
|
- TellPhone: patient.TellPhone,
|
535
|
|
- ContactName: patient.ContactName,
|
536
|
|
- UpdatedTime: time.Now().Unix(),
|
|
527
|
+ InfectiousNextRecordTime: patient.InfectiousNextRecordTime,
|
|
528
|
+ IsInfectious: patient.IsInfectious,
|
|
529
|
+ RemindCycle: patient.RemindCycle,
|
|
530
|
+ ResponseResult: patient.ResponseResult,
|
|
531
|
+ IsOpenRemind: patient.IsOpenRemind,
|
|
532
|
+ FirstTreatmentDate: patient.FirstTreatmentDate,
|
|
533
|
+ DialysisAge: patient.DialysisAge,
|
|
534
|
+ ExpenseKind: patient.ExpenseKind,
|
|
535
|
+ TellPhone: patient.TellPhone,
|
|
536
|
+ ContactName: patient.ContactName,
|
|
537
|
+ UpdatedTime: time.Now().Unix(),
|
537
|
538
|
}
|
538
|
539
|
// //更新病人ID获取新表病人ID
|
539
|
540
|
err = service.UpdatepatientTwo(&patientsNew, id)
|
|
@@ -3337,3 +3338,27 @@ func (c *PatientApiController) PostIsOpenRemind() {
|
3337
|
3338
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
3338
|
3339
|
}
|
3339
|
3340
|
}
|
|
3341
|
+
|
|
3342
|
+func (c *PatientApiController) GetPatientScheduleOne() {
|
|
3343
|
+ id, _ := c.GetInt64("id")
|
|
3344
|
+ //查询该病人是否当天是排班
|
|
3345
|
+ nowDateTime := time.Now()
|
|
3346
|
+ nowDate := nowDateTime.Format("2006-01-02")
|
|
3347
|
+ nowDate += " 00:00:00"
|
|
3348
|
+ timeLayout := "2006-01-02"
|
|
3349
|
+ loc, _ := time.LoadLocation("Local")
|
|
3350
|
+ theTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", nowDate, loc)
|
|
3351
|
+ nowdate := theTime.Unix()
|
|
3352
|
+ fmt.Println("nowdate", nowdate)
|
|
3353
|
+ adminUser := c.GetAdminUserInfo()
|
|
3354
|
+ orgId := adminUser.CurrentOrgId
|
|
3355
|
+ fmt.Println("orgid", orgId)
|
|
3356
|
+ scheduls, err := service.GetPatientScheduleOne(id, nowdate, orgId)
|
|
3357
|
+ if err != nil {
|
|
3358
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
3359
|
+ return
|
|
3360
|
+ }
|
|
3361
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
3362
|
+ "scheduls": scheduls,
|
|
3363
|
+ })
|
|
3364
|
+}
|