Browse Source

新功能

csx 4 years ago
parent
commit
143c95c683

+ 2 - 2
controllers/dialysis_api_controller.go View File

@@ -4867,7 +4867,7 @@ func (this *DialysisApiController) GetTodayMonitor() {
4867 4867
 			}
4868 4868
 
4869 4869
 			// 只针对方济医院
4870
-			if template.TemplateId == 1 {
4870
+			if template.TemplateId == 1 && adminInfo.CurrentOrgId != 9849 {
4871 4871
 				value, _ := strconv.ParseFloat(fmt.Sprintf("%.3f", prescription.TargetUltrafiltration/float64(totalMin)*60), 6)
4872 4872
 				ultrafiltration_rate = value
4873 4873
 				record.UltrafiltrationRate = ultrafiltration_rate
@@ -4876,7 +4876,7 @@ func (this *DialysisApiController) GetTodayMonitor() {
4876 4876
 	}
4877 4877
 	// record.UltrafiltrationRate = ultrafiltration_rate
4878 4878
 	record.UltrafiltrationVolume = 0
4879
-	if template.TemplateId == 1 {
4879
+	if template.TemplateId == 1 && adminInfo.CurrentOrgId != 9849 {
4880 4880
 		if ultrafiltration_rate > 0 {
4881 4881
 			value, _ := strconv.ParseFloat(fmt.Sprintf("%.3f", float64(record.OperateTime+3600-fristrecord.OperateTime)/3600*ultrafiltration_rate), 6)
4882 4882
 			record.UltrafiltrationVolume = value

+ 1 - 1
controllers/dialysis_record_api_controller.go View File

@@ -2159,7 +2159,7 @@ func (this *DialysisRecordAPIController) StartDialysis() {
2159 2159
 					ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration / float64(totalMin) * 60 * 1000)
2160 2160
 				}
2161 2161
 				// 只针对方济医院
2162
-				if template.TemplateId == 1 {
2162
+				if template.TemplateId == 1 && adminUserInfo.CurrentOrgId != 9849 {
2163 2163
 					value, _ := strconv.ParseFloat(fmt.Sprintf("%.3f", prescription.TargetUltrafiltration/float64(totalMin)*60), 6)
2164 2164
 					ultrafiltration_rate = value
2165 2165
 				}

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

@@ -286,7 +286,6 @@ func (this *DialysisAPIController) DialysisRecord() {
286 286
 	}
287 287
 
288 288
 	dialysisOrder, getDialysisOrderErr := service.MobileGetSchedualDialysisRecord(adminInfo.Org.Id, patientID, date.Unix())
289
-	fmt.Println("----------------------------", getDialysisOrderErr)
290 289
 	if getDialysisOrderErr != nil {
291 290
 		this.ErrorLog("获取透析记录失败:%v", getDialysisOrderErr)
292 291
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -383,7 +382,7 @@ func (this *DialysisAPIController) DialysisRecord() {
383 382
 		return
384 383
 	}
385 384
 
386
-	headNurses, _ := service.GetAllSpecialPermissionAdminUsersWithoutStatus(adminInfo.Org.Id, adminInfo.App.Id, models.SpecialPermissionTypeHeadNurse)
385
+	//headNurses, _ := service.GetAllSpecialPermissionAdminUsersWithoutStatus(adminInfo.Org.Id, adminInfo.App.Id, models.SpecialPermissionTypeHeadNurse)
387 386
 
388 387
 	_, gobalConfig := service.FindAutomaticReduceRecordByOrgId(adminInfo.Org.Id)
389 388
 	goodTypes, _ := service.FindAllGoodTypeByType(1)          //查出所有库存配置的系统类型
@@ -410,12 +409,12 @@ func (this *DialysisAPIController) DialysisRecord() {
410 409
 		"last_predialysis_evaluation":    lastPredialysisEvaluation,
411 410
 		"last_assessment_after_dislysis": lastAssessmentAfterDislysis,
412 411
 		"last_monitor_record":            lastMonitorRecord,
413
-		"special_premission":             headNurses,
414
-		"config":                         gobalConfig,
415
-		"types":                          goodTypes,
416
-		"goodInfos":                      goodInfos,
417
-		"dry_weight":                     lastDryWeightDislysis,
418
-		"system_prescription":            systemDialysisPrescribe,
412
+		//"special_premission":             headNurses,
413
+		"config":              gobalConfig,
414
+		"types":               goodTypes,
415
+		"goodInfos":           goodInfos,
416
+		"dry_weight":          lastDryWeightDislysis,
417
+		"system_prescription": systemDialysisPrescribe,
419 418
 	}
420 419
 	this.ServeSuccessJSON(returnData)
421 420
 }
@@ -2756,7 +2755,7 @@ func (this *DialysisAPIController) StartDialysis() {
2756 2755
 			}
2757 2756
 
2758 2757
 			// 只针对方济医院
2759
-			if template.TemplateId == 1 {
2758
+			if template.TemplateId == 1 && adminUserInfo.Org.Id != 9849 {
2760 2759
 				value, _ := strconv.ParseFloat(fmt.Sprintf("%.3f", prescription.TargetUltrafiltration/float64(totalMin)*60), 6)
2761 2760
 				ultrafiltration_rate = value
2762 2761
 			}
@@ -5613,7 +5612,7 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
5613 5612
 			}
5614 5613
 
5615 5614
 			// 只针对方济医院
5616
-			if template.TemplateId == 1 {
5615
+			if template.TemplateId == 1 && adminInfo.Org.Id != 9849 {
5617 5616
 				value, _ := strconv.ParseFloat(fmt.Sprintf("%.3f", prescription.TargetUltrafiltration/float64(totalMin)*60), 6)
5618 5617
 				ultrafiltration_rate = value
5619 5618
 				record.UltrafiltrationRate = ultrafiltration_rate
@@ -5622,7 +5621,7 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
5622 5621
 	}
5623 5622
 	// record.UltrafiltrationRate = ultrafiltration_rate
5624 5623
 	record.UltrafiltrationVolume = 0
5625
-	if template.TemplateId == 1 { //adminInfo.Org.Id == 3907 || adminInfo.Org.Id == 4 || adminInfo.Org.Id == 12 || adminInfo.Org.Id == 13 || adminInfo.Org.Id == 9535adminInfo.Org.Id == 3907 || adminInfo.Org.Id == 4 || adminInfo.Org.Id == 12 || adminInfo.Org.Id == 13 || adminInfo.Org.Id == 9535
5624
+	if template.TemplateId == 1 && adminInfo.Org.Id != 9849 { //adminInfo.Org.Id == 3907 || adminInfo.Org.Id == 4 || adminInfo.Org.Id == 12 || adminInfo.Org.Id == 13 || adminInfo.Org.Id == 9535adminInfo.Org.Id == 3907 || adminInfo.Org.Id == 4 || adminInfo.Org.Id == 12 || adminInfo.Org.Id == 13 || adminInfo.Org.Id == 9535
5626 5625
 		if ultrafiltration_rate > 0 {
5627 5626
 			value, _ := strconv.ParseFloat(fmt.Sprintf("%.3f", float64(record.OperateTime+3600-fristrecord.OperateTime)/3600*ultrafiltration_rate), 6)
5628 5627
 			record.UltrafiltrationVolume = value

+ 5 - 16
models/dialysis.go View File

@@ -274,22 +274,11 @@ func (PredialysisEvaluation) TableName() string {
274 274
 }
275 275
 
276 276
 type PredialysisEvaluationList struct {
277
-	ID                          int64   `gorm:"column:id" json:"id"`
278
-	UserOrgId                   int64   `gorm:"column:user_org_id" json:"user_org_id"`
279
-	PatientId                   int64   `gorm:"column:patient_id" json:"patient_id"`
280
-	AssessmentDate              int64   `gorm:"column:assessment_date" json:"assessment_date"`
281
-	DialysisOrderId             int64   `gorm:"column:dialysis_order_id" json:"dialysis_order_id"`
282
-	DryWeight                   float64 `gorm:"column:dry_weight" json:"dry_weight"`
283
-	SystolicBloodPressure       float64 `gorm:"column:systolic_blood_pressure" json:"systolic_blood_pressure"`
284
-	DiastolicBloodPressure      float64 `gorm:"column:diastolic_blood_pressure" json:"diastolic_blood_pressure"`
285
-	WeightAfterLastTransparency float64 `gorm:"column:weight_after_last_transparency" json:"weight_after_last_transparency"`
286
-	WeighingWay                 string  `gorm:"column:weighing_way" json:"weighing_way"`
287
-	WeighingBefore              float64 `gorm:"column:weighing_before" json:"weighing_before"`
288
-	AdditionalWeight            float64 `gorm:"column:additional_weight" json:"additional_weight"`
289
-	WeightBefore                float64 `gorm:"column:weight_before" json:"weight_before"`
290
-	Evaluator                   int64   `gorm:"column:evaluator" json:"evaluator"`
291
-	Creater                     int64   `gorm:"column:creater" json:"creater"`
292
-	CreatedTime                 int64   `gorm:"column:created_time" json:"created_time"`
277
+	ID             int64   `gorm:"column:id" json:"id"`
278
+	UserOrgId      int64   `gorm:"column:user_org_id" json:"user_org_id"`
279
+	PatientId      int64   `gorm:"column:patient_id" json:"patient_id"`
280
+	AssessmentDate int64   `gorm:"column:assessment_date" json:"assessment_date"`
281
+	WeightBefore   float64 `gorm:"column:weight_before" json:"weight_before"`
293 282
 }
294 283
 
295 284
 func (PredialysisEvaluationList) TableName() string {

+ 0 - 2
models/patient_models.go View File

@@ -230,11 +230,9 @@ type DialysisPrescriptionList struct {
230 230
 	ID         int64 `gorm:"column:id" json:"id"`
231 231
 	UserOrgId  int64 `gorm:"column:user_org_id" json:"user_org_id"`
232 232
 	PatientId  int64 `gorm:"column:patient_id" json:"patient_id"`
233
-	ModeId     int64 `gorm:"column:mode_id" json:"mode_id"`
234 233
 	RecordDate int64 `gorm:"column:record_date" json:"record_date"`
235 234
 	RecordId   int64 `gorm:"column:record_id" json:"record_id"`
236 235
 	Creater    int64 `gorm:"column:creater" json:"creater"`
237
-	Modifier   int64 `gorm:"column:modifier" json:"modifier"`
238 236
 }
239 237
 
240 238
 func (DialysisPrescriptionList) TableName() string {

+ 1 - 3
service/dialysis_service.go View File

@@ -608,11 +608,9 @@ func GetDialysisScheduals(orgID int64, scheduleDate int64) ([]*MDialysisSchedule
608 608
 		Preload("DeviceNumber", "status = 1 AND org_id = ?", orgID).
609 609
 		Preload("DeviceNumber.Zone", "status = 1 AND org_id = ?", orgID).
610 610
 		// Preload("DeviceZone", "status = 1 AND org_id = ?", orgID).
611
-		Preload("TreatmentMode", "status = 1").
612 611
 		Preload("DialysisOrder", "status = 1 AND user_org_id = ?", orgID).
613 612
 		Preload("AssessmentBeforeDislysis", "status = 1 AND user_org_id = ?", orgID).
614 613
 		Preload("Prescription", "status = 1 AND user_org_id = ?", orgID).
615
-		Preload("TreatmentSummary", "status = 1 AND user_org_id = ?", orgID).
616 614
 		// Preload("DialysisOrder.MonitoringRecords", "status = 1 AND user_org_id = ?", orgID).
617 615
 		Where("status = 1 AND user_org_id = ?", orgID)
618 616
 	if scheduleDate != 0 {
@@ -639,7 +637,7 @@ func GetDialysisWatch(orgID int64, schedulDate int64, schedulType int64, partiti
639 637
 		Preload("AssessmentBeforeDislysis", "status = 1 AND  user_org_id = ?", orgID).
640 638
 		Preload("AssessmentAfterDislysis", "status = 1 AND  user_org_id = ?", orgID).
641 639
 		Preload("MonitoringRecord", func(db *gorm.DB) *gorm.DB {
642
-			return db.Where("status = 1 AND user_org_id = ?", orgID).Order("operate_time desc")
640
+			return db.Where("status = 1 AND user_org_id = ?", orgID).Order("operate_time asc")
643 641
 		}).
644 642
 		Preload("DialysisOrder", "status = 1 AND user_org_id = ?", orgID).
645 643
 		Preload("MonitorPatients", "status = 1 AND user_org_id = ?", orgID)

+ 21 - 17
service/mobile_dialysis_service.go View File

@@ -30,7 +30,6 @@ func MobileGetDialysisScheduals(orgID int64, scheduleDate int64, scheduleType in
30 30
 		Preload("SchedualPatient", "status = 1 AND user_org_id = ?", orgID).
31 31
 		Preload("DeviceNumber", "status = 1 AND org_id = ?", orgID).
32 32
 		Preload("DeviceNumber.Zone", "status = 1 AND org_id = ?", orgID).
33
-		Preload("TreatmentMode", "status = 1").
34 33
 		Preload("Advices", "status = 1 AND user_org_id = ? AND advice_type = 2", orgID).
35 34
 		Preload("Prescription", "status = 1 AND user_org_id = ? AND record_date = ?", orgID, scheduleDate).
36 35
 		Preload("AssessmentBeforeDislysis", "status = 1 AND user_org_id = ? AND assessment_date = ? ", orgID, scheduleDate).
@@ -59,7 +58,6 @@ func MobileGetWaitingScheduals(orgID int64, scheduleDate int64) ([]*MDialysisSch
59 58
 		Preload("DeviceNumber", "status = 1 AND org_id = ?", orgID).
60 59
 		Preload("DeviceNumber.Zone", "status = 1 AND org_id = ?", orgID).
61 60
 		// Preload("DeviceZone", "status = 1 AND org_id = ?", orgID).
62
-		Preload("TreatmentMode", "status = 1").
63 61
 		Preload("Prescription", "status = 1 AND user_org_id = ? AND record_date = ?", orgID, scheduleDate).
64 62
 		Preload("AssessmentBeforeDislysis", "status = 1 AND user_org_id = ? AND assessment_date = ? ", orgID, scheduleDate).
65 63
 		Preload("DialysisOrder", "status = 1 AND user_org_id = ?", orgID).
@@ -86,13 +84,10 @@ type MDialysisScheduleVM struct {
86 84
 
87 85
 	SchedualPatient          *MSchedualPatientVMList           `gorm:"ForeignKey:PatientId" json:"patient"`
88 86
 	DeviceNumber             *MDeviceNumberVM                  `gorm:"ForeignKey:BedId" json:"device_number"`
89
-	DeviceZone               *models.DeviceZone                `gorm:"ForeignKey:PartitionId" json:"device_zone"`
90
-	TreatmentMode            *models.TreatmentMode             `gorm:"ForeignKey:ModeId" json:"treatment_mode"`
91 87
 	DialysisOrder            *MDialysisOrderVMList             `gorm:"ForeignKey:DialysisDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"dialysis_order"`
92 88
 	Prescription             *models.DialysisPrescriptionList  `gorm:"ForeignKey:RecordDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"prescription"`
93 89
 	AssessmentBeforeDislysis *models.PredialysisEvaluationList `gorm:"ForeignKey:AssessmentDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"assessment_before_dislysis"`
94
-	TreatmentSummary         *models.TreatmentSummary          `gorm:"ForeignKey:AssessmentDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"treatment_summary"`
95
-	Advices                  []*models.DoctorAdvice            `gorm:"ForeignKey:AdviceDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"doctor_advice"`
90
+	Advices                  []*VMDoctorAdvice                 `gorm:"ForeignKey:AdviceDate,PatientId;AssociationForeignKey:ScheduleDate,PatientId" json:"doctor_advice"`
96 91
 }
97 92
 
98 93
 func (MDialysisScheduleVM) TableName() string {
@@ -239,23 +234,32 @@ type MDialysisOrderVMList struct {
239 234
 	// PrescriptionId int64  `gorm:"column:prescription_id" json:"prescription_id"`
240 235
 	Stage int64 `gorm:"column:stage" json:"stage"`
241 236
 	// Remark         string `gorm:"column:remark" json:"remark"`
242
-	BedID          int64            `gorm:"column:bed_id" json:"bed_id"`
243
-	StartNurse     int64            `gorm:"column:start_nurse" json:"start_nurse"`
244
-	FinishNurse    int64            `gorm:"column:finish_nurse" json:"finish_nurse"`
245
-	Status         int64            `gorm:"column:status" json:"status"`
246
-	PunctureNurse  int64            `gorm:"column:puncture_nurse" json:"puncture_nurse"`
247
-	DeviceNumber   *MDeviceNumberVM `gorm:"ForeignKey:BedID" json:"device_number"`
248
-	Creator        int64            `gorm:"column:creator" json:"creator"`
249
-	Modifier       int64            `gorm:"column:modifier" json:"modifier"`
250
-	FinishCreator  int64            `gorm:"column:finish_creator" json:"finish_creator"`
251
-	FinishModifier int64            `gorm:"column:finish_modifier" json:"finish_modifier"`
252
-	SchedualType   int64            `gorm:"column:schedual_type" json:"schedual_type"`
237
+	BedID        int64            `gorm:"column:bed_id" json:"bed_id"`
238
+	StartNurse   int64            `gorm:"column:start_nurse" json:"start_nurse"`
239
+	Status       int64            `gorm:"column:status" json:"status"`
240
+	DeviceNumber *MDeviceNumberVM `gorm:"ForeignKey:BedID" json:"device_number"`
241
+	Creator      int64            `gorm:"column:creator" json:"creator"`
253 242
 }
254 243
 
255 244
 func (MDialysisOrderVMList) TableName() string {
256 245
 	return "xt_dialysis_order"
257 246
 }
258 247
 
248
+type VMDoctorAdvice struct {
249
+	ID             int64 `gorm:"column:id" json:"id" form:"id"`
250
+	GroupNo        int64 `gorm:"column:groupno" json:"groupno" form:"groupno"`
251
+	UserOrgId      int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
252
+	PatientId      int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
253
+	AdviceDate     int64 `gorm:"column:advice_date" json:"advice_date" form:"advice_date"`
254
+	Status         int64 `gorm:"column:status" json:"status" form:"status"`
255
+	ExecutionState int64 `gorm:"column:execution_state" json:"execution_state" form:"execution_state"`
256
+	RecordDate     int64 `gorm:"column:record_date" json:"record_date"`
257
+}
258
+
259
+func (VMDoctorAdvice) TableName() string {
260
+	return "xt_doctor_advice"
261
+}
262
+
259 263
 // 获取透析记录
260 264
 func MobileGetDialysisRecord(orgID int64, patientID int64, recordDate int64) (*models.DialysisOrder, error) {
261 265
 	var record models.DialysisOrder