Browse Source

历史排班

28169 1 year ago
parent
commit
f6cb781d52

+ 10 - 0
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -118,6 +118,8 @@ func (this *DialysisAPIController) Scheduals() {
118 118
 
119 119
 				hisAdvices, _ := service.GetAllHisAdvicesByList(orgID, date.Unix())
120 120
 				inforMation, _ := service.GetTodayInforMation(orgID, date.Unix())
121
+
122
+				//monitor, _ := service.GetMonitorByListSix(orgID, date.Unix())
121 123
 				for key, item := range scheduals {
122 124
 
123 125
 					for _, infor := range inforMation {
@@ -204,6 +206,14 @@ func (this *DialysisAPIController) Scheduals() {
204 206
 							break
205 207
 						}
206 208
 					}
209
+
210
+					////	监测
211
+					//scheduals[key].VMMonitoringRecord = make([]models.VMMonitoringRecord, 0)
212
+					//for _, moni := range monitor {
213
+					//	if item.PatientId == moni.PatientId {
214
+					//		scheduals[key].VMMonitoringRecord = append(scheduals[key].VMMonitoringRecord, moni)
215
+					//	}
216
+					//}
207 217
 				}
208 218
 				//缓存数据
209 219
 				scheduals_json, err := json.Marshal(&scheduals)

+ 5 - 0
models/new_monitor.go View File

@@ -117,6 +117,11 @@ type VMMonitoringRecord struct {
117 117
 	Status                 int64   `gorm:"column:status" json:"status"`
118 118
 	AccumulatedBloodVolume float64 `gorm:"column:accumulated_blood_volume" json:"accumulated_blood_volume" form:"accumulated_blood_volume"`
119 119
 	UltrafiltrationVolume  float64 `gorm:"column:ultrafiltration_volume" json:"ultrafiltration_volume" form:"ultrafiltration_volume"`
120
+	VenousPressure         float64 `gorm:"column:venous_pressure" json:"venous_pressure" form:"venous_pressure"`
121
+	ArterialPressure       float64 `gorm:"column:arterial_pressure" json:"arterial_pressure" form:"arterial_pressure"`
122
+	BloodOxygenSaturation  string  `gorm:"column:blood_oxygen_saturation" json:"blood_oxygen_saturation" form:"blood_oxygen_saturation"`
123
+	Dispose                string  `gorm:"column:dispose" json:"dispose" form:"dispose"`
124
+	Result                 string  `gorm:"column:result" json:"result" form:"result"`
120 125
 }
121 126
 
122 127
 func (VMMonitoringRecord) TableName() string {

+ 1 - 1
service/manage_service.go View File

@@ -768,7 +768,7 @@ func QueryInfo(bed int64, start int64, end int64, orgId int64, limit int64, page
768 768
 	}
769 769
 	offset := (page - 1) * limit
770 770
 
771
-	err = db.Group("x.id").Select("x.id,x.date,x.class,x.zone,x.bed_number,x.patient_id,x.contagion,x.dialysis_mode,x.start_time,x.end_time,x.dialysis_hour,x.hyperfiltratio,x.weight_loss,x.warning_value,x.user_total,x.move,x.failure_stage,x.fault_description,x.code_information,x.disinfect_type,x.disinfectant_type,x.disinfection,x.machine_run,x.fluid_path,x.disinfectant,x.disinfection_status,x.disinfection_residue,x.long_time,x.disinfec_startime,x.disinfec_endtime,x.dialysis_checked,x.dialysis_name,x.norms,x.dialysis_concentration,x.germ_checked,x.germ_name,x.germ_number,x.clean,x.sign_name,x.equiment_id,x.bed,p.name,r.user_name").Count(&total).Joins("Left Join sgj_xt.xt_patients as p on p.id = x.patient_id").Joins("Left Join sgj_user_admin_role as r on r.admin_user_id = x.sign_name").Order("x.ctime desc").Offset(offset).Limit(limit).Scan(&infor).Error
771
+	err = db.Group("x.id").Select("x.id,x.date,x.class,x.zone,x.bed_number,x.patient_id,x.contagion,x.dialysis_mode,x.start_time,x.end_time,x.dialysis_hour,x.hyperfiltratio,x.weight_loss,x.warning_value,x.user_total,x.move,x.failure_stage,x.fault_description,x.code_information,x.disinfect_type,x.disinfectant_type,x.disinfection,x.machine_run,x.fluid_path,x.disinfectant,x.disinfection_status,x.disinfection_residue,x.long_time,x.disinfec_startime,x.disinfec_endtime,x.dialysis_checked,x.dialysis_name,x.norms,x.dialysis_concentration,x.germ_checked,x.germ_name,x.germ_number,x.clean,x.sign_name,x.equiment_id,x.bed,p.name,r.user_name").Count(&total).Joins("Left Join sgj_xt.xt_patients as p on p.id = x.patient_id").Joins("Left Join sgj_user_admin_role as r on r.admin_user_id = x.sign_name").Order("x.date desc").Offset(offset).Limit(limit).Scan(&infor).Error
772 772
 	if err != nil {
773 773
 
774 774
 		return

+ 1 - 0
service/mobile_dialysis_service.go View File

@@ -159,6 +159,7 @@ type MDialysisScheduleVMForList struct {
159 159
 	DialysisSolution         *models.DialysisSolution          `gorm:"ForeignKey:PatientId,ModeId;AssociationForeignKey:PatientId,ModeId" json:"dialysis_solution"`
160 160
 	DoubleCheck              *models.DoubleCheck               `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"dobule_check"`
161 161
 	NewDeviceInformation     *NewDeviceInformation             `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"device_information"`
162
+	//VMMonitoringRecord       []models.VMMonitoringRecord       `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"monitor_record"`
162 163
 }
163 164
 
164 165
 func (MDialysisScheduleVMForList) TableName() string {

+ 6 - 0
service/patient_service.go View File

@@ -153,6 +153,12 @@ func GetAllDevicetByListSix(orgID int64) (devices []*models.MDeviceNumberForList
153 153
 	return devices, err
154 154
 }
155 155
 
156
+func GetMonitorByListSix(orgID int64, monitor_date int64) (monitor []models.VMMonitoringRecord, err error) {
157
+
158
+	err = readDb.Where("user_org_id = ? and monitor_date = ? and status =1", orgID, monitor_date).Find(&monitor).Error
159
+	return monitor, err
160
+}
161
+
156 162
 func GetAllDevicetByList(orgID int64) (devices []*models.MDeviceNumberForList, err error) {
157 163
 	redis := RedisClient()
158 164
 	defer redis.Close()

+ 7 - 0
service/schedule_service.go View File

@@ -1718,3 +1718,10 @@ func CreateNewSchedule(schedule models.XtSchedule) error {
1718 1718
 
1719 1719
 	return err
1720 1720
 }
1721
+
1722
+func GetNumberListById(id int64, org_id int64) (number []*models.DeviceNumber, err error) {
1723
+
1724
+	err = XTReadDB().Where("zone_id = ? and org_id = ? and status= 1", id, org_id).Find(&number).Error
1725
+
1726
+	return number, err
1727
+}