Browse Source

耗材参数

XMLWAN 3 years ago
parent
commit
4472fbf8e8

+ 4 - 2
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -1903,7 +1903,7 @@ func (this *DialysisAPIController) StartDialysis() {
1903 1903
 			}
1904 1904
 			//针对监利大垸医院
1905 1905
 			if template.TemplateId == 41 {
1906
-				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration / float64(totalMin) * 60 * 1000)
1906
+				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration * 60 / float64(totalMin) * 1000)
1907 1907
 				fmt.Println("hhhh232332322323232332", ultrafiltration_rate)
1908 1908
 			}
1909 1909
 
@@ -2469,7 +2469,9 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
2469 2469
 			}
2470 2470
 
2471 2471
 			if template.TemplateId == 41 {
2472
-				ultrafiltration_rate = math.Ceil(prescription.TargetUltrafiltration / float64(totalMin) * 60 * 1000)
2472
+				fmt.Println("hhhhhhhhhh", prescription.TargetUltrafiltration)
2473
+				fmt.Println("jj2332323322323", float64(totalMin))
2474
+				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration * 60 / float64(totalMin) * 1000)
2473 2475
 				fmt.Println("ultrafiltration_rate000304293929329238328328328328238328328", ultrafiltration_rate)
2474 2476
 				record.UltrafiltrationRate = ultrafiltration_rate
2475 2477
 			}

+ 1 - 0
controllers/schedule_api_controller.go View File

@@ -2383,6 +2383,7 @@ func (this *ScheduleApiController) GetBloodScheduleList() {
2383 2383
 	if week_type == 0 {
2384 2384
 		startDate, _ := utils.ParseTimeStringToTime("2006-01-02", startTime)
2385 2385
 		list, err := service.GetWeekDayScheduleByIdTwo(orgId, targetDay.Unix(), week_time, startDate.Unix(), zone)
2386
+		fmt.Println("e23332232323232323322323", err)
2386 2387
 		if err != nil {
2387 2388
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2388 2389
 			return

+ 90 - 0
models/patient_models.go View File

@@ -1197,3 +1197,93 @@ type VmPatients struct {
1197 1197
 func (VmPatients) TableName() string {
1198 1198
 	return "xt_patients"
1199 1199
 }
1200
+
1201
+type XtAssessmentBeforeDislysis struct {
1202
+	ID                             int64   `gorm:"column:id" json:"id" form:"id"`
1203
+	UserOrgId                      int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1204
+	PatientId                      int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
1205
+	AssessmentDate                 int64   `gorm:"column:assessment_date" json:"assessment_date" form:"assessment_date"`
1206
+	DialysisOrderId                int64   `gorm:"column:dialysis_order_id" json:"dialysis_order_id" form:"dialysis_order_id"`
1207
+	Temperature                    float64 `gorm:"column:temperature" json:"temperature" form:"temperature"`
1208
+	PulseFrequency                 float64 `gorm:"column:pulse_frequency" json:"pulse_frequency" form:"pulse_frequency"`
1209
+	BreathingRate                  float64 `gorm:"column:breathing_rate" json:"breathing_rate" form:"breathing_rate"`
1210
+	SystolicBloodPressure          float64 `gorm:"column:systolic_blood_pressure" json:"systolic_blood_pressure" form:"systolic_blood_pressure"`
1211
+	DiastolicBloodPressure         float64 `gorm:"column:diastolic_blood_pressure" json:"diastolic_blood_pressure" form:"diastolic_blood_pressure"`
1212
+	BloodPressureType              int64   `gorm:"column:blood_pressure_type" json:"blood_pressure_type" form:"blood_pressure_type"`
1213
+	DryWeight                      float64 `gorm:"column:dry_weight" json:"dry_weight" form:"dry_weight"`
1214
+	WeightAfterLastTransparency    float64 `gorm:"column:weight_after_last_transparency" json:"weight_after_last_transparency" form:"weight_after_last_transparency"`
1215
+	WeighingWay                    string  `gorm:"column:weighing_way" json:"weighing_way" form:"weighing_way"`
1216
+	WeighingBefore                 float64 `gorm:"column:weighing_before" json:"weighing_before" form:"weighing_before"`
1217
+	AdditionalWeight               float64 `gorm:"column:additional_weight" json:"additional_weight" form:"additional_weight"`
1218
+	WeightBefore                   float64 `gorm:"column:weight_before" json:"weight_before" form:"weight_before"`
1219
+	WeightGain                     float64 `gorm:"column:weight_gain" json:"weight_gain" form:"weight_gain"`
1220
+	PreloadedDewatering            float64 `gorm:"column:preloaded_dewatering" json:"preloaded_dewatering" form:"preloaded_dewatering"`
1221
+	UltrafiltrationAmount          float64 `gorm:"column:ultrafiltration_amount" json:"ultrafiltration_amount" form:"ultrafiltration_amount"`
1222
+	DialysisInterphase             string  `gorm:"column:dialysis_interphase" json:"dialysis_interphase" form:"dialysis_interphase"`
1223
+	LastPostDialysis               string  `gorm:"column:last_post_dialysis" json:"last_post_dialysis" form:"last_post_dialysis"`
1224
+	SymptomBeforeDialysis          string  `gorm:"column:symptom_before_dialysis" json:"symptom_before_dialysis" form:"symptom_before_dialysis"`
1225
+	InternalFistula                string  `gorm:"column:internal_fistula" json:"internal_fistula" form:"internal_fistula"`
1226
+	InternalFistulaSkin            string  `gorm:"column:internal_fistula_skin" json:"internal_fistula_skin" form:"internal_fistula_skin"`
1227
+	CatheterBend                   int64   `gorm:"column:catheter_bend" json:"catheter_bend" form:"catheter_bend"`
1228
+	Catheter                       string  `gorm:"column:catheter" json:"catheter" form:"catheter"`
1229
+	Complication                   string  `gorm:"column:complication" json:"complication" form:"complication"`
1230
+	Evaluator                      int64   `gorm:"column:evaluator" json:"evaluator" form:"evaluator"`
1231
+	Creater                        int64   `gorm:"column:creater" json:"creater" form:"creater"`
1232
+	Remark                         string  `gorm:"column:remark" json:"remark" form:"remark"`
1233
+	Status                         int64   `gorm:"column:status" json:"status" form:"status"`
1234
+	CreatedTime                    int64   `gorm:"column:created_time" json:"created_time" form:"created_time"`
1235
+	UpdatedTime                    int64   `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
1236
+	Modifier                       int64   `gorm:"column:modifier" json:"modifier" form:"modifier"`
1237
+	BloodAccessPartId              string  `gorm:"column:blood_access_part_id" json:"blood_access_part_id" form:"blood_access_part_id"`
1238
+	BloodAccessPartOperaId         int64   `gorm:"column:blood_access_part_opera_id" json:"blood_access_part_opera_id" form:"blood_access_part_opera_id"`
1239
+	IsHemorrhage                   int64   `gorm:"column:is_hemorrhage" json:"is_hemorrhage" form:"is_hemorrhage"`
1240
+	Hemorrhage                     string  `gorm:"column:hemorrhage" json:"hemorrhage" form:"hemorrhage"`
1241
+	HemorrhageOther                string  `gorm:"column:hemorrhage_other" json:"hemorrhage_other" form:"hemorrhage_other"`
1242
+	PunctureMethod                 string  `gorm:"column:puncture_method" json:"puncture_method" form:"puncture_method"`
1243
+	BloodAccessInternalFistula     string  `gorm:"column:blood_access_internal_fistula" json:"blood_access_internal_fistula" form:"blood_access_internal_fistula"`
1244
+	InternalFistulaOther           string  `gorm:"column:internal_fistula_other" json:"internal_fistula_other" form:"internal_fistula_other"`
1245
+	BloodAccessNoise               int64   `gorm:"column:blood_access_noise" json:"blood_access_noise" form:"blood_access_noise"`
1246
+	PunctureWay                    string  `gorm:"column:puncture_way" json:"puncture_way" form:"puncture_way"`
1247
+	VenousCatheterization          int64   `gorm:"column:venous_catheterization" json:"venous_catheterization" form:"venous_catheterization"`
1248
+	VenousCatheterizationPart      int64   `gorm:"column:venous_catheterization_part" json:"venous_catheterization_part" form:"venous_catheterization_part"`
1249
+	VenousCatheterizationPartOther string  `gorm:"column:venous_catheterization_part_other" json:"venous_catheterization_part_other" form:"venous_catheterization_part_other"`
1250
+	DuctusArantii                  string  `gorm:"column:ductus_arantii" json:"ductus_arantii" form:"ductus_arantii"`
1251
+	EmergencyTreatment             int64   `gorm:"column:emergency_treatment" json:"emergency_treatment" form:"emergency_treatment"`
1252
+	EmergencyTreatmentOther        string  `gorm:"column:emergency_treatment_other" json:"emergency_treatment_other" form:"emergency_treatment_other"`
1253
+	DialysisCount                  int64   `gorm:"column:dialysis_count" json:"dialysis_count" form:"dialysis_count"`
1254
+	AssessmentDoctor               int64   `gorm:"column:assessment_doctor" json:"assessment_doctor" form:"assessment_doctor"`
1255
+	AssessmentTime                 int64   `gorm:"column:assessment_time" json:"assessment_time" form:"assessment_time"`
1256
+	MachineType                    string  `gorm:"column:machine_type" json:"machine_type" form:"machine_type"`
1257
+	IsInfect                       int64   `gorm:"column:is_infect" json:"is_infect" form:"is_infect"`
1258
+	Exposed                        float64 `gorm:"column:exposed" json:"exposed" form:"exposed"`
1259
+	Skin                           string  `gorm:"column:skin" json:"skin" form:"skin"`
1260
+	SkinOther                      string  `gorm:"column:skin_other" json:"skin_other" form:"skin_other"`
1261
+	InfectOther                    string  `gorm:"column:infect_other" json:"infect_other" form:"infect_other"`
1262
+	DuctusArantiiOther             string  `gorm:"column:ductus_arantii_other" json:"ductus_arantii_other" form:"ductus_arantii_other"`
1263
+	PunctureNeedle                 string  `gorm:"column:puncture_needle" json:"puncture_needle" form:"puncture_needle"`
1264
+	DialysisIntakesUnit            int64   `gorm:"column:dialysis_intakes_unit" json:"dialysis_intakes_unit" form:"dialysis_intakes_unit"`
1265
+	HumorExcessiveSymptom          int64   `gorm:"column:humor_excessive_symptom" json:"humor_excessive_symptom" form:"humor_excessive_symptom"`
1266
+	LastPostDialysisOther          string  `gorm:"column:last_post_dialysis_other" json:"last_post_dialysis_other" form:"last_post_dialysis_other"`
1267
+	SymptomBeforeDialysisOther     string  `gorm:"column:symptom_before_dialysis_other" json:"symptom_before_dialysis_other" form:"symptom_before_dialysis_other"`
1268
+	DialysisInterphaseOther        string  `gorm:"column:dialysis_interphase_other" json:"dialysis_interphase_other" form:"dialysis_interphase_other"`
1269
+	Pinholing                      string  `gorm:"column:pinholing" json:"pinholing" form:"pinholing"`
1270
+	CatheterSuture                 string  `gorm:"column:catheter_suture" json:"catheter_suture" form:"catheter_suture"`
1271
+	CatheterSutureOther            string  `gorm:"column:catheter_suture_other" json:"catheter_suture_other" form:"catheter_suture_other"`
1272
+	UrineVolume                    float64 `gorm:"column:urine_volume" json:"urine_volume" form:"urine_volume"`
1273
+	Edema                          string  `gorm:"column:edema" json:"edema" form:"edema"`
1274
+	SpecialTreatment               string  `gorm:"column:special_treatment" json:"special_treatment" form:"special_treatment"`
1275
+	CatheterMaintenance            string  `gorm:"column:catheter_maintenance" json:"catheter_maintenance" form:"catheter_maintenance"`
1276
+	ThrombusAv                     string  `gorm:"column:thrombus_av" json:"thrombus_av" form:"thrombus_av"`
1277
+	ThromubusA                     string  `gorm:"column:thromubus_a" json:"thromubus_a" form:"thromubus_a"`
1278
+	ThromubusV                     string  `gorm:"column:thromubus_v" json:"thromubus_v" form:"thromubus_v"`
1279
+	ThromubusType                  int64   `gorm:"column:thromubus_type" json:"thromubus_type" form:"thromubus_type"`
1280
+	Dehydration                    string  `gorm:"column:dehydration" json:"dehydration" form:"dehydration"`
1281
+	PreDialysisDrugs               string  `gorm:"column:pre_dialysis_drugs" json:"pre_dialysis_drugs" form:"pre_dialysis_drugs"`
1282
+	EstimatedFoodIntake            string  `gorm:"column:estimated_food_intake" json:"estimated_food_intake" form:"estimated_food_intake"`
1283
+	Period                         int64   `gorm:"column:period" json:"period" form:"period"`
1284
+	BloodPressureDuringDialysis    string  `gorm:"column:blood_pressure_during_dialysis" json:"blood_pressure_during_dialysis" form:"blood_pressure_during_dialysis"`
1285
+}
1286
+
1287
+func (XtAssessmentBeforeDislysis) TableName() string {
1288
+	return "xt_assessment_before_dislysis"
1289
+}

+ 11 - 9
models/schedule_models.go View File

@@ -139,7 +139,8 @@ type WeekSchedule struct {
139 139
 	DoctorAdvice         []*DoctorAdvice        `json:"doctoradvice" gorm:"foreignkey:AdviceDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
140 140
 	HisDoctorAdviceInfo  []*HisDoctorAdviceInfo `json:"hisdoctoradviceinfo" gorm:"foreignkey:AdviceDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
141 141
 	//DialysisSolution     []*DialysisSolution    `json:"dialysissolution" gorm:"foreignkey:PatientId,ModeId;AssociationForeignKey:PatientId,ModeId"`
142
-	DialysisSolution DialysisSolution `json:"dialysissolution" gorm:"foreignkey:PatientId,ModeId;AssociationForeignKey:PatientId,ModeId"`
142
+	DialysisSolution           DialysisSolution           `json:"dialysissolution" gorm:"foreignkey:PatientId,ModeId;AssociationForeignKey:PatientId,ModeId"`
143
+	XtAssessmentBeforeDislysis XtAssessmentBeforeDislysis `json:"assessmentbefor" gorm:"foreignkey:PatientId,AssessmentDate;AssociationForeignKey:PatientId,ScheduleDate"`
143 144
 }
144 145
 
145 146
 func (WeekSchedule) TableName() string {
@@ -187,14 +188,15 @@ type VmSchedulesRemind struct {
187 188
 	UpdatedTime  int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
188 189
 	IsExport     int64 `gorm:"column:is_export" json:"is_export" form:"is_export"`
189 190
 
190
-	DeviceZone           DeviceZone             `json:"zone" gorm:"foreignkey:ID;AssociationForeignKey:PartitionId;"`
191
-	DeviceNumber         DeviceNumber           `json:"number" gorm:"foreignkey:ID;AssociationForeignKey:BedId;"`
192
-	DialysisOrder        DialysisOrder          `json:"order" gorm:"foreignkey:DialysisDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
193
-	XtPatients           XtPatients             `json:"patient" gorm:"foreignkey:ID;AssociationForeignKey:PatientId;"`
194
-	DoctorAdvice         []*DoctorAdvice        `json:"doctoradvice" gorm:"foreignkey:AdviceDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
195
-	DialysisPrescription DialysisPrescription   `json:"prescription" gorm:"foreignkey:RecordDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
196
-	HisDoctorAdviceInfo  []*HisDoctorAdviceInfo `json:"hisdoctoradviceinfo" gorm:"foreignkey:AdviceDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
197
-	DialysisSolution     DialysisSolution       `json:"dialysissolution" gorm:"foreignkey:RecordDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
191
+	DeviceZone                 DeviceZone                 `json:"zone" gorm:"foreignkey:ID;AssociationForeignKey:PartitionId;"`
192
+	DeviceNumber               DeviceNumber               `json:"number" gorm:"foreignkey:ID;AssociationForeignKey:BedId;"`
193
+	DialysisOrder              DialysisOrder              `json:"order" gorm:"foreignkey:DialysisDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
194
+	XtPatients                 XtPatients                 `json:"patient" gorm:"foreignkey:ID;AssociationForeignKey:PatientId;"`
195
+	DoctorAdvice               []*DoctorAdvice            `json:"doctoradvice" gorm:"foreignkey:AdviceDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
196
+	DialysisPrescription       DialysisPrescription       `json:"prescription" gorm:"foreignkey:RecordDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
197
+	HisDoctorAdviceInfo        []*HisDoctorAdviceInfo     `json:"hisdoctoradviceinfo" gorm:"foreignkey:AdviceDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
198
+	DialysisSolution           DialysisSolution           `json:"dialysissolution" gorm:"foreignkey:RecordDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
199
+	XtAssessmentBeforeDislysis XtAssessmentBeforeDislysis `json:"assessmentbefor" gorm:"foreignkey:AssessmentDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId;"`
198 200
 }
199 201
 
200 202
 func (VmSchedulesRemind) TableName() string {

+ 2 - 2
service/gobal_config_service.go View File

@@ -659,7 +659,7 @@ func GetDrugCountList(startime int64, endtime int64, orgid int64) (info []*model
659 659
 	return info, err
660 660
 }
661 661
 
662
-func GetMinCountList(startime int64, endtime int64, orgid int64) (info []*models.VmDrugWarehouseInfo, err error) {
662
+func GetMinCountList(startime int64, endtime int64, orgid int64) (info []*models.DrugWarehouseInfo, err error) {
663 663
 	db := XTReadDB().Table("xt_drug_warehouse_info as x").Where("x.status = 1")
664 664
 
665 665
 	if startime > 0 {
@@ -671,7 +671,7 @@ func GetMinCountList(startime int64, endtime int64, orgid int64) (info []*models
671 671
 	if orgid > 0 {
672 672
 		db = db.Where("x.org_id = ?", orgid)
673 673
 	}
674
-	err = db.Select("sum(x.stock_min_number) as count,x.drug_id").Group("x.drug_id").Scan(&info).Error
674
+	err = db.Select("sum(x.warehousing_count) as warehousing_count,x.drug_id").Group("x.drug_id").Scan(&info).Error
675 675
 	return info, err
676 676
 }
677 677
 

+ 3 - 2
service/schedule_service.go View File

@@ -605,7 +605,7 @@ func GetWeekDayScheduleByIdThee(orgid int64, scheduleDate int64, scheduleType in
605 605
 		db = db.Where("x.partition_id in (?)", zone)
606 606
 	}
607 607
 
608
-	err = db.Select("x.id,x.user_org_id,x.partition_id,x.bed_id,x.patient_id,x.schedule_date,x.schedule_type,x.schedule_week,x.mode_id,x.is_export").Preload("XtPatients", "status = 1").Preload("DeviceZone", "status = 1").Preload("DeviceNumber", "status = 1").Preload("DialysisOrder", "status = 1").Preload("DoctorAdvice", func(db *gorm.DB) *gorm.DB {
608
+	err = db.Select("x.id,x.user_org_id,x.partition_id,x.bed_id,x.patient_id,x.schedule_date,x.schedule_type,x.schedule_week,x.mode_id,x.is_export").Preload("XtPatients", "status = 1").Preload("DeviceZone", "status = 1").Preload("DeviceNumber", "status = 1").Preload("DialysisOrder", "status = 1").Preload("XtAssessmentBeforeDislysis", "status = 1").Preload("DoctorAdvice", func(db *gorm.DB) *gorm.DB {
609 609
 		return db.Where("status =1 and parent_id = 0").Preload("ChildDoctorAdvice", "status = 1")
610 610
 	}).Preload("HisDoctorAdviceInfo", "status = 1").Preload("DialysisPrescription", "status = 1").Preload("DialysisSolution", func(db *gorm.DB) *gorm.DB {
611 611
 		return db.Where("status =1").Order("id asc")
@@ -630,7 +630,7 @@ func GetWeekDayScheduleByIdTwo(orgid int64, scheduleDate int64, scheduleType int
630 630
 		db = db.Where("x.partition_id in (?)", zone)
631 631
 	}
632 632
 
633
-	err = db.Select("x.id,x.user_org_id,x.partition_id,x.bed_id,x.patient_id,x.schedule_date,x.schedule_type,x.schedule_week,x.mode_id,x.is_export").Preload("XtPatients", "status = 1").Preload("DeviceZone", "status = 1").Preload("DeviceNumber", "status = 1").Preload("DialysisOrder", "status = 1").Preload("DoctorAdvice", func(db *gorm.DB) *gorm.DB {
633
+	err = db.Select("x.id,x.user_org_id,x.partition_id,x.bed_id,x.patient_id,x.schedule_date,x.schedule_type,x.schedule_week,x.mode_id,x.is_export").Preload("XtPatients", "status = 1").Preload("DeviceZone", "status = 1").Preload("DeviceNumber", "status = 1").Preload("DialysisOrder", "status = 1").Preload("XtAssessmentBeforeDislysis", "status = 1").Preload("DoctorAdvice", func(db *gorm.DB) *gorm.DB {
634 634
 		return db.Where("status =1 and parent_id = 0").Preload("ChildDoctorAdvice", "status = 1")
635 635
 	}).Preload("HisDoctorAdviceInfo", "status = 1").Preload("DialysisPrescription", "status = 1").Preload("DialysisSolution", func(db *gorm.DB) *gorm.DB {
636 636
 		return db.Where("status =1").Order("id asc")
@@ -807,6 +807,7 @@ func GetNextWeekDaySchedule(weektype int64, weektime int64, startime int64, endt
807 807
 	err = db.
808 808
 		Preload("DeviceZone", "status = 1 ").
809 809
 		Preload("DeviceNumber", "status = 1 ").
810
+		Preload("XtAssessmentBeforeDislysis", "status = 1").
810 811
 		Preload("DialysisPrescription", func(db *gorm.DB) *gorm.DB {
811 812
 			return db.Where("status = 1").Order("id asc")
812 813
 		}).Preload("DialysisSolution", func(db *gorm.DB) *gorm.DB {