Browse Source

体积小

XMLWAN 3 years ago
parent
commit
85ba4bac76

+ 14 - 12
controllers/xcx_mobile_api_controller.go/xcx_api_controller.go View File

507
 	loc, _ := time.LoadLocation("Local")
507
 	loc, _ := time.LoadLocation("Local")
508
 	time_now := time.Now().Format("2006-01-02")
508
 	time_now := time.Now().Format("2006-01-02")
509
 	timeNowUnix, _ := time.ParseInLocation(timeLayout+"15:04:05", time_now+"00:00:00", loc)
509
 	timeNowUnix, _ := time.ParseInLocation(timeLayout+"15:04:05", time_now+"00:00:00", loc)
510
-	fmt.Println("timeNowUnix", timeNowUnix.Unix())
511
 
510
 
511
+	fmt.Println("timeNowUnix", timeNowUnix.Unix())
512
+	//获取该患者最后一次排班
513
+	list, _ := service.GetLastScheduleList(patientID)
512
 	patient, getPatientErr := service.MobileGetPatientDetail(info.UserOrgId, patientID)
514
 	patient, getPatientErr := service.MobileGetPatientDetail(info.UserOrgId, patientID)
513
 	if getPatientErr != nil {
515
 	if getPatientErr != nil {
514
 		this.ErrorLog("获取患者信息失败:%v", getPatientErr)
516
 		this.ErrorLog("获取患者信息失败:%v", getPatientErr)
527
 		return
529
 		return
528
 	}
530
 	}
529
 
531
 
530
-	receiverTreatmentAccess, getRTARErr := service.MobileGetReceiverTreatmentAccessRecordOne(info.UserOrgId, patientID, timeNowUnix.Unix())
532
+	receiverTreatmentAccess, getRTARErr := service.MobileGetReceiverTreatmentAccessRecordOne(info.UserOrgId, patientID, list.ScheduleDate)
531
 	if getRTARErr != nil {
533
 	if getRTARErr != nil {
532
 		this.ErrorLog("获取接诊评估失败:%v", getRTARErr)
534
 		this.ErrorLog("获取接诊评估失败:%v", getRTARErr)
533
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
535
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
534
 		return
536
 		return
535
 	}
537
 	}
536
 
538
 
537
-	predialysisEvaluation, getPEErr := service.MobileGetPredialysisEvaluationOne(info.UserOrgId, patientID, timeNowUnix.Unix())
539
+	predialysisEvaluation, getPEErr := service.MobileGetPredialysisEvaluationOne(info.UserOrgId, patientID, list.ScheduleDate)
538
 	if getPEErr != nil {
540
 	if getPEErr != nil {
539
 		this.ErrorLog("获取透前评估失败:%v", getPEErr)
541
 		this.ErrorLog("获取透前评估失败:%v", getPEErr)
540
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
542
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
548
 		return
550
 		return
549
 	}
551
 	}
550
 
552
 
551
-	doctorAdvices, getDoctorAdvicesErr := service.MobileGetDoctorAdvicesByGroupsOne(info.UserOrgId, patientID, timeNowUnix.Unix())
553
+	doctorAdvices, getDoctorAdvicesErr := service.MobileGetDoctorAdvicesByGroupsOne(info.UserOrgId, patientID, list.ScheduleDate)
552
 	if getDoctorAdvicesErr != nil {
554
 	if getDoctorAdvicesErr != nil {
553
 		this.ErrorLog("获取临时医嘱失败:%v", getDoctorAdvicesErr)
555
 		this.ErrorLog("获取临时医嘱失败:%v", getDoctorAdvicesErr)
554
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
556
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
555
 		return
557
 		return
556
 	}
558
 	}
557
 
559
 
558
-	dialysisOrder, getDialysisOrderErr := service.MobileGetSchedualDialysisRecordOne(info.UserOrgId, patientID, timeNowUnix.Unix())
560
+	dialysisOrder, getDialysisOrderErr := service.MobileGetSchedualDialysisRecordOne(info.UserOrgId, patientID, list.ScheduleDate)
559
 	if getDialysisOrderErr != nil {
561
 	if getDialysisOrderErr != nil {
560
 		this.ErrorLog("获取透析记录失败:%v", getDialysisOrderErr)
562
 		this.ErrorLog("获取透析记录失败:%v", getDialysisOrderErr)
561
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
563
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
562
 		return
564
 		return
563
 	}
565
 	}
564
 
566
 
565
-	doubleCheck, getDoubleCheckErr := service.MobileGetDoubleCheckOne(info.UserOrgId, patientID, timeNowUnix.Unix())
567
+	doubleCheck, getDoubleCheckErr := service.MobileGetDoubleCheckOne(info.UserOrgId, patientID, list.ScheduleDate)
566
 	if getDoubleCheckErr != nil {
568
 	if getDoubleCheckErr != nil {
567
 		this.ErrorLog("获取双人核对记录失败:%v", getDoubleCheckErr)
569
 		this.ErrorLog("获取双人核对记录失败:%v", getDoubleCheckErr)
568
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
570
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
569
 		return
571
 		return
570
 	}
572
 	}
571
 
573
 
572
-	monitorRecords, getMonitorRecordsErr := service.MobileGetMonitorRecordsOne(info.UserOrgId, patientID, timeNowUnix.Unix())
574
+	monitorRecords, getMonitorRecordsErr := service.MobileGetMonitorRecordsOne(info.UserOrgId, patientID, list.ScheduleDate)
573
 	if getMonitorRecordsErr != nil {
575
 	if getMonitorRecordsErr != nil {
574
 		this.ErrorLog("获取透析监测记录失败:%v", getMonitorRecordsErr)
576
 		this.ErrorLog("获取透析监测记录失败:%v", getMonitorRecordsErr)
575
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
577
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
584
 		return
586
 		return
585
 	}
587
 	}
586
 
588
 
587
-	assessmentAfterDislysis, getAADErr := service.MobileGetAssessmentAfterDislysisOne(info.UserOrgId, patientID, timeNowUnix.Unix())
589
+	assessmentAfterDislysis, getAADErr := service.MobileGetAssessmentAfterDislysisOne(info.UserOrgId, patientID, list.ScheduleDate)
588
 	if getAADErr != nil {
590
 	if getAADErr != nil {
589
 		this.ErrorLog("获取透后评估失败:%v", getAADErr)
591
 		this.ErrorLog("获取透后评估失败:%v", getAADErr)
590
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
592
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
591
 		return
593
 		return
592
 	}
594
 	}
593
 
595
 
594
-	lastAssessmentAfterDislysis, getLAADErr := service.MobileGetAssessmentAfterDislysisOne(info.UserOrgId, patientID, timeNowUnix.Unix())
596
+	lastAssessmentAfterDislysis, getLAADErr := service.MobileGetAssessmentAfterDislysisOne(info.UserOrgId, patientID, list.ScheduleDate)
595
 	if getLAADErr != nil {
597
 	if getLAADErr != nil {
596
 		this.ErrorLog("获取上一次透后评估失败:%v", getLAADErr)
598
 		this.ErrorLog("获取上一次透后评估失败:%v", getLAADErr)
597
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
599
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
598
 		return
600
 		return
599
 	}
601
 	}
600
 
602
 
601
-	treatmentSummary, getTreatmentSummaryErr := service.MobileGetTreatmentSummaryOne(info.UserOrgId, patientID, timeNowUnix.Unix())
603
+	treatmentSummary, getTreatmentSummaryErr := service.MobileGetTreatmentSummaryOne(info.UserOrgId, patientID, list.ScheduleDate)
602
 	if getTreatmentSummaryErr != nil {
604
 	if getTreatmentSummaryErr != nil {
603
 		this.ErrorLog("获取治疗小结失败:%v", getTreatmentSummaryErr)
605
 		this.ErrorLog("获取治疗小结失败:%v", getTreatmentSummaryErr)
604
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
606
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
625
 	//获取最后一次血管通路
627
 	//获取最后一次血管通路
626
 	lastAssessment, _ := service.GetLastPassWayAssessment(info.UserOrgId, patientID)
628
 	lastAssessment, _ := service.GetLastPassWayAssessment(info.UserOrgId, patientID)
627
 
629
 
628
-	prescribeOne, _ := service.MobileGetDialysisPrescribeByModeIdFive(info.UserOrgId, patientID, timeNowUnix.Unix())
630
+	prescribeOne, _ := service.MobileGetDialysisPrescribeByModeIdFive(info.UserOrgId, patientID, list.ScheduleDate)
629
 	var his_advices []*models.HisDoctorAdviceInfo
631
 	var his_advices []*models.HisDoctorAdviceInfo
630
 	if is_open_config.IsOpen == 1 {
632
 	if is_open_config.IsOpen == 1 {
631
-		his_advices, _ = service.GetAllHisDoctorAdviceOne(info.UserOrgId, patientID, timeNowUnix.Unix())
633
+		his_advices, _ = service.GetAllHisDoctorAdviceOne(info.UserOrgId, patientID, list.ScheduleDate)
632
 	}
634
 	}
633
 
635
 
634
 	if getLPEErr != nil {
636
 	if getLPEErr != nil {

+ 24 - 0
models/xcx_user_models.go View File

536
 	Ctime      int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
536
 	Ctime      int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
537
 	Mtime      int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
537
 	Mtime      int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
538
 }
538
 }
539
+
540
+func (XcxGobalTemplate) TableName() string {
541
+	return "xt_gobal_template"
542
+}
543
+
544
+type XcxSchedule struct {
545
+	ID           int64 `gorm:"column:id" json:"id" form:"id"`
546
+	UserOrgId    int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
547
+	PartitionId  int64 `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
548
+	BedId        int64 `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
549
+	PatientId    int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
550
+	ScheduleDate int64 `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
551
+	ScheduleType int64 `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
552
+	ScheduleWeek int64 `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
553
+	ModeId       int64 `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
554
+	Status       int64 `gorm:"column:status" json:"status" form:"status"`
555
+	CreatedTime  int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
556
+	UpdatedTime  int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
557
+	IsExport     int64 `gorm:"column:is_export" json:"is_export" form:"is_export"`
558
+}
559
+
560
+func (XcxSchedule) TableName() string {
561
+	return "his_doctor_advice_info"
562
+}

+ 7 - 0
service/xcx_mobile_api_service.go View File

572
 	err = XTReadDB().Model(&list).Where("(org_id = ? or org_id = 0) and status = 1", orgid).Find(&list).Error
572
 	err = XTReadDB().Model(&list).Where("(org_id = ? or org_id = 0) and status = 1", orgid).Find(&list).Error
573
 	return list, err
573
 	return list, err
574
 }
574
 }
575
+
576
+func GetLastScheduleList(patient_id int64) (models.XcxSchedule, error) {
577
+
578
+	schedule := models.XcxSchedule{}
579
+	err := XTReadDB().Where("patient_id = ? and status = 1", patient_id).Last(&schedule).Error
580
+	return schedule, err
581
+}