Browse Source

历史排班

28169 2 months ago
parent
commit
96194e390b

+ 14 - 3
controllers/dialysis_api_controller.go View File

2596
 				//lastDialysisPrescribe, _ = service.MobileGetLastDialysisPrescribe(adminUserInfo.Org.Id, id,schedual.ModeId)
2596
 				//lastDialysisPrescribe, _ = service.MobileGetLastDialysisPrescribe(adminUserInfo.Org.Id, id,schedual.ModeId)
2597
 				// 获取透析模版
2597
 				// 获取透析模版
2598
 				dialysisPrescribe, _ = service.MobileGetDialysisPrescribe(adminUserInfo.CurrentOrgId, patient, recordDate.Unix())
2598
 				dialysisPrescribe, _ = service.MobileGetDialysisPrescribe(adminUserInfo.CurrentOrgId, patient, recordDate.Unix())
2599
-				dialysisSolution, _ = service.MobileGetDialysisSolution(adminUserInfo.CurrentOrgId, patient)
2599
+				// 获取透析模版
2600
+				dialysisSolution, _ = service.MobileGetDialysisSolutionByModeIdSix(adminUserInfo.CurrentOrgId, patient, schedual.ModeId)
2600
 
2601
 
2601
 				if dialysisPrescribe == nil && dialysisSolution != nil {
2602
 				if dialysisPrescribe == nil && dialysisSolution != nil {
2602
 					mode_id = dialysisSolution.ModeId
2603
 					mode_id = dialysisSolution.ModeId
2650
 				newprescribe.DialyzerPerfusionApparatus = dialysisSolution.DialyzerPerfusionApparatus
2651
 				newprescribe.DialyzerPerfusionApparatus = dialysisSolution.DialyzerPerfusionApparatus
2651
 				newprescribe.BodyFluidOther = dialysisSolution.BodyFluidOther
2652
 				newprescribe.BodyFluidOther = dialysisSolution.BodyFluidOther
2652
 				newprescribe.TargetKtv = dialysisSolution.TargetKtv
2653
 				newprescribe.TargetKtv = dialysisSolution.TargetKtv
2653
-
2654
+				newprescribe.DialysisStrainer = dialysisSolution.DialysisStrainer
2655
+				newprescribe.DialysisIrrigation = dialysisSolution.DialysisIrrigation
2656
+				newprescribe.DialysisDialyszers = dialysisSolution.DialysisDialyszers
2654
 				newprescribe.CreatedTime = time.Now().Unix()
2657
 				newprescribe.CreatedTime = time.Now().Unix()
2655
 				newprescribe.UpdatedTime = time.Now().Unix()
2658
 				newprescribe.UpdatedTime = time.Now().Unix()
2656
 				newprescribe.RecordDate = recordDate.Unix()
2659
 				newprescribe.RecordDate = recordDate.Unix()
2722
 					newprescribe.DialyzerPerfusionApparatus = lastDialysisPrescribe.DialyzerPerfusionApparatus
2725
 					newprescribe.DialyzerPerfusionApparatus = lastDialysisPrescribe.DialyzerPerfusionApparatus
2723
 					newprescribe.BodyFluidOther = lastDialysisPrescribe.BodyFluidOther
2726
 					newprescribe.BodyFluidOther = lastDialysisPrescribe.BodyFluidOther
2724
 					newprescribe.TargetKtv = lastDialysisPrescribe.TargetKtv
2727
 					newprescribe.TargetKtv = lastDialysisPrescribe.TargetKtv
2728
+					newprescribe.DialysisStrainer = lastDialysisPrescribe.DialysisStrainer
2729
+					newprescribe.DialysisIrrigation = lastDialysisPrescribe.DialysisIrrigation
2730
+					newprescribe.DialysisDialyszers = lastDialysisPrescribe.DialysisDialyszers
2725
 					newprescribe.CreatedTime = time.Now().Unix()
2731
 					newprescribe.CreatedTime = time.Now().Unix()
2726
 					newprescribe.UpdatedTime = time.Now().Unix()
2732
 					newprescribe.UpdatedTime = time.Now().Unix()
2727
 					newprescribe.RecordDate = recordDate.Unix()
2733
 					newprescribe.RecordDate = recordDate.Unix()
2953
 			newprescribe.DialyzerPerfusionApparatus = dialysisSolution.DialyzerPerfusionApparatus
2959
 			newprescribe.DialyzerPerfusionApparatus = dialysisSolution.DialyzerPerfusionApparatus
2954
 			newprescribe.BodyFluidOther = dialysisSolution.BodyFluidOther
2960
 			newprescribe.BodyFluidOther = dialysisSolution.BodyFluidOther
2955
 			newprescribe.TargetKtv = dialysisSolution.TargetKtv
2961
 			newprescribe.TargetKtv = dialysisSolution.TargetKtv
2956
-
2962
+			newprescribe.DialysisStrainer = dialysisSolution.DialysisStrainer
2963
+			newprescribe.DialysisIrrigation = dialysisSolution.DialysisIrrigation
2964
+			newprescribe.DialysisDialyszers = dialysisSolution.DialysisDialyszers
2957
 			newprescribe.CreatedTime = time.Now().Unix()
2965
 			newprescribe.CreatedTime = time.Now().Unix()
2958
 			newprescribe.UpdatedTime = time.Now().Unix()
2966
 			newprescribe.UpdatedTime = time.Now().Unix()
2959
 			newprescribe.RecordDate = recordDate.Unix()
2967
 			newprescribe.RecordDate = recordDate.Unix()
3030
 				newprescribe.DewaterAmount = dewater_amount
3038
 				newprescribe.DewaterAmount = dewater_amount
3031
 				newprescribe.TargetUltrafiltration = dewater_amount
3039
 				newprescribe.TargetUltrafiltration = dewater_amount
3032
 				newprescribe.Chaptalization = lastDialysisPrescribe.Chaptalization
3040
 				newprescribe.Chaptalization = lastDialysisPrescribe.Chaptalization
3041
+				newprescribe.DialysisStrainer = lastDialysisPrescribe.DialysisStrainer
3042
+				newprescribe.DialysisIrrigation = lastDialysisPrescribe.DialysisIrrigation
3043
+				newprescribe.DialysisDialyszers = lastDialysisPrescribe.DialysisDialyszers
3033
 				newprescribe.Status = 1
3044
 				newprescribe.Status = 1
3034
 
3045
 
3035
 				err := service.AddSigleRecord(&newprescribe)
3046
 				err := service.AddSigleRecord(&newprescribe)

+ 3 - 0
controllers/mobile_api_controllers/patient_api_controller.go View File

2702
 		newprescribe.Status = 1
2702
 		newprescribe.Status = 1
2703
 		newprescribe.DialysisDialyszers = dialysisSolution.DialysisDialyszers
2703
 		newprescribe.DialysisDialyszers = dialysisSolution.DialysisDialyszers
2704
 		newprescribe.DialysisIrrigation = dialysisSolution.DialysisIrrigation
2704
 		newprescribe.DialysisIrrigation = dialysisSolution.DialysisIrrigation
2705
+		newprescribe.DialysisStrainer = dialysisSolution.DialysisStrainer
2705
 		newprescribe.Remark = lastDialysisPrescription.Remark
2706
 		newprescribe.Remark = lastDialysisPrescription.Remark
2706
 		newprescribe.Chaptalization = lastDialysisPrescribe.Chaptalization
2707
 		newprescribe.Chaptalization = lastDialysisPrescribe.Chaptalization
2707
 
2708
 
2864
 			newprescribe.Status = 1
2865
 			newprescribe.Status = 1
2865
 			newprescribe.DialysisIrrigation = lastDialysisPrescribe.DialysisIrrigation
2866
 			newprescribe.DialysisIrrigation = lastDialysisPrescribe.DialysisIrrigation
2866
 			newprescribe.DialysisDialyszers = lastDialysisPrescribe.DialysisDialyszers
2867
 			newprescribe.DialysisDialyszers = lastDialysisPrescribe.DialysisDialyszers
2868
+			newprescribe.DialysisStrainer = dialysisSolution.DialysisStrainer
2867
 			newprescribe.Remark = lastDialysisPrescription.Remark
2869
 			newprescribe.Remark = lastDialysisPrescription.Remark
2868
 			newprescribe.Chaptalization = lastDialysisPrescribe.Chaptalization
2870
 			newprescribe.Chaptalization = lastDialysisPrescribe.Chaptalization
2869
 			_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, theAssessmentDateTime, adminUserInfo.Org.Id)
2871
 			_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, theAssessmentDateTime, adminUserInfo.Org.Id)
3018
 			newprescribe.Status = 1
3020
 			newprescribe.Status = 1
3019
 			newprescribe.DialysisDialyszers = system_dialysisPrescribe.DialysisDialyszers
3021
 			newprescribe.DialysisDialyszers = system_dialysisPrescribe.DialysisDialyszers
3020
 			newprescribe.DialysisIrrigation = system_dialysisPrescribe.DialysisIrrigation
3022
 			newprescribe.DialysisIrrigation = system_dialysisPrescribe.DialysisIrrigation
3023
+			newprescribe.DialysisStrainer = dialysisSolution.DialysisStrainer
3021
 			newprescribe.Remark = lastDialysisPrescription.Remark
3024
 			newprescribe.Remark = lastDialysisPrescription.Remark
3022
 			newprescribe.Chaptalization = lastDialysisPrescribe.Chaptalization
3025
 			newprescribe.Chaptalization = lastDialysisPrescribe.Chaptalization
3023
 			_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, theAssessmentDateTime, adminUserInfo.Org.Id)
3026
 			_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, theAssessmentDateTime, adminUserInfo.Org.Id)

+ 1 - 1
service/mobile_dialysis_service.go View File

2321
 // 透析方案
2321
 // 透析方案
2322
 func MobileGetDialysisSolutionByModeIdSix(orgID int64, patientID int64, mode_id int64) (*models.DialysisSolution, error) {
2322
 func MobileGetDialysisSolutionByModeIdSix(orgID int64, patientID int64, mode_id int64) (*models.DialysisSolution, error) {
2323
 	var record models.DialysisSolution
2323
 	var record models.DialysisSolution
2324
-	err := readDb.Model(&models.DialysisSolution{}).Where("patient_id = ? and user_org_id = ? and status = 1 AND mode_id = ?", patientID, orgID, mode_id).Last(&record).Error
2324
+	err := readDb.Model(&models.DialysisSolution{}).Where("patient_id = ? and user_org_id = ? and status = 1 AND mode_id = ? and solution_status =1", patientID, orgID, mode_id).Last(&record).Error
2325
 	if err != nil {
2325
 	if err != nil {
2326
 		if err == gorm.ErrRecordNotFound {
2326
 		if err == gorm.ErrRecordNotFound {
2327
 			return nil, nil
2327
 			return nil, nil