ソースを参照

Merge branch '20200710_xt_api_new_branch' of http://git.shengws.com/csx/XT_New into 20200710_xt_api_new_branch

XMLWAN 4 年 前
コミット
0fb47e3bfc

+ 32 - 17
conf/app.conf ファイルの表示

@@ -150,26 +150,26 @@ readmysqlhost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
150 150
 readmysqlport = 3306
151 151
 readmysqluser = root
152 152
 readmysqlpass = 1Q2W3e4r!@#$
153
-readmysqlname = sgj_xt
153
+readmysqlname = test_xt
154 154
 
155 155
 writemysqlhost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
156 156
 writemysqlport = 3306
157 157
 writemysqluser = root
158 158
 writemysqlpass = 1Q2W3e4r!@#$
159
-writemysqlname = sgj_xt
159
+writemysqlname = test_xt
160 160
 
161 161
 readuserhost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
162 162
 readuserport = 3306
163 163
 readuseruser = root
164 164
 readuserpass = 1Q2W3e4r!@#$
165
-readusername = sgj_users
165
+readusername = test_users
166 166
 
167 167
 
168 168
 writeuserhost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
169 169
 writeuserport = 3306
170 170
 writeuseruser = root
171 171
 writeuserpass = 1Q2W3e4r!@#$
172
-writeusername = sgj_users
172
+writeusername = test_users
173 173
 
174 174
 
175 175
 
@@ -221,16 +221,31 @@ redisport = 6379
221 221
 redispasswrod = 123456
222 222
 redisdb = 0
223 223
 
224
-niprocart =  83
225
-jms = 80
226
-fistula_needle_set = 81
227
-fistula_needle_set_16 = 82
228
-hemoperfusion = 85
229
-dialyser_sterilised = 84
230
-filtryzer = 79
231
-dialyzers = 10000
232
-injector = 10001
233
-bloodlines = 10002
234
-tubingHemodialysis = 10003
235
-package = 10004
236
-aliquid = 10005
224
+
225
+        niprocart =  63
226
+        jms = 58
227
+        fistula_needle_set = 65
228
+        fistula_needle_set_16 = 64
229
+        hemoperfusion = 55
230
+        dialyser_sterilised = 12
231
+        filtryzer = 53
232
+                dialyzers = 8
233
+                injector = 81
234
+                bloodlines = 42
235
+        tubingHemodialysis = 30
236
+        package = 82
237
+        aliquid = 83
238
+
239
+#niprocart =  83
240
+#jms = 80
241
+#fistula_needle_set = 81
242
+#fistula_needle_set_16 = 82
243
+#hemoperfusion = 85
244
+#dialyser_sterilised = 84
245
+#filtryzer = 79
246
+#dialyzers = 10000
247
+#injector = 10001
248
+#bloodlines = 10002
249
+#tubingHemodialysis = 10003
250
+#package = 10004
251
+#aliquid = 10005

+ 2 - 2
controllers/dialysis_api_controller.go ファイルの表示

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

+ 1 - 1
controllers/dialysis_record_api_controller.go ファイルの表示

@@ -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 ファイルの表示

@@ -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

+ 41 - 6
controllers/new_mobile_api_controllers/index_evaluation_api_controller.go ファイルの表示

@@ -2,6 +2,7 @@ package new_mobile_api_controllers
2 2
 
3 3
 import (
4 4
 	"XT_New/enums"
5
+	"XT_New/models"
5 6
 	"XT_New/service/statistics_service"
6 7
 	"XT_New/utils"
7 8
 	"fmt"
@@ -24,11 +25,35 @@ func (this *IndexEvaluationApiController) GetAdminUser() {
24 25
 //初始化数据
25 26
 func (this *IndexEvaluationApiController) GetLaboratoryIndexInitData() {
26 27
 	adminUserInfo := this.GetMobileAdminUserInfo()
27
-	references, _ := statistics_service.FindOrgQualityControlStandardInspectionReference(adminUserInfo.Org.Id)
28
+	var references []*models.InspectionReference
29
+	count, _ := statistics_service.FindOrgInspectionCount(adminUserInfo.Org.Id)
30
+	if count <= 0 {
31
+		references, _ = statistics_service.FindOrgInspectionReference(0, 1)
32
+		references2, _ := statistics_service.FindOrgInspectionReference(0, 2)
33
+		references = append(references, references2...)
34
+
35
+	} else {
36
+		references, _ = statistics_service.FindOrgInspectionReference(adminUserInfo.Org.Id, 1)
37
+		references2, _ := statistics_service.FindOrgInspectionReference(adminUserInfo.Org.Id, 2)
38
+		references = append(references, references2...)
39
+
40
+	}
41
+
28 42
 	this.ServeSuccessJSON(map[string]interface{}{
29 43
 		"references": references,
30 44
 	})
31 45
 
46
+	//adminUserInfo := this.GetMobileAdminUserInfo()
47
+	//
48
+	//
49
+	//
50
+	//references, _ := statistics_service.FindOrgInspectionReference(adminUserInfo.Org.Id,1)
51
+	//references2, _ := statistics_service.FindOrgInspectionReference(adminUserInfo.Org.Id,2)
52
+	//references = append(references, references2...)
53
+	//this.ServeSuccessJSON(map[string]interface{}{
54
+	//	"references": references,
55
+	//})
56
+
32 57
 }
33 58
 
34 59
 //获取取值范围
@@ -38,10 +63,20 @@ func (this *IndexEvaluationApiController) GetLaboratoryIndexProjectRangeValueDat
38 63
 	item_id, _ := this.GetInt64("item_id")
39 64
 	adminUserInfo := this.GetMobileAdminUserInfo()
40 65
 	var range_vaule []string
66
+	var qcs models.InspectionReference
67
+
41 68
 	if range_type == 1 {
42
-		qcs, _ := statistics_service.FindOrgConfigRangeTypeValue(adminUserInfo.Org.Id, project_id, item_id)
43
-		range_vaule = append(range_vaule, qcs.MinRange)
44
-		range_vaule = append(range_vaule, qcs.LargeRange)
69
+		count, _ := statistics_service.FindOrgInspectionCount(adminUserInfo.Org.Id)
70
+
71
+		if count <= 0 {
72
+			qcs, _ = statistics_service.FindOrgConfigRangeTypeValue(0, project_id, item_id)
73
+		} else {
74
+			qcs, _ = statistics_service.FindOrgConfigRangeTypeValue(adminUserInfo.Org.Id, project_id, item_id)
75
+
76
+		}
77
+		//qcs, _ := statistics_service.FindOrgConfigRangeTypeValue(adminUserInfo.Org.Id, project_id, item_id)
78
+		range_vaule = append(range_vaule, qcs.RangeMin)
79
+		range_vaule = append(range_vaule, qcs.RangeMax)
45 80
 	} else {
46 81
 		inspection, _ := statistics_service.FindOrgInspectionReferenceRangeTypeValue(adminUserInfo.Org.Id, project_id, item_id)
47 82
 		for _, item := range inspection {
@@ -84,7 +119,7 @@ func (this *IndexEvaluationApiController) GetInspectionChartData() {
84 119
 	var range_value string
85 120
 	if range_type == 1 {
86 121
 		qcs, _ := statistics_service.FindOrgConfigRangeTypeValue(adminUserInfo.Org.Id, project_id, item_id)
87
-		range_value = qcs.MinRange + "," + qcs.LargeRange
122
+		range_value = qcs.RangeMin + "," + qcs.RangeMax
88 123
 
89 124
 	} else {
90 125
 
@@ -218,7 +253,7 @@ func (this *IndexEvaluationApiController) GetPatientInspectionBarChartData() {
218 253
 	if range_type == 1 {
219 254
 		qcs, _ := statistics_service.FindOrgConfigRangeTypeValue(adminUserInfo.Org.Id, project_id, item_id)
220 255
 
221
-		range_value = qcs.MinRange + "," + qcs.LargeRange
256
+		range_value = qcs.RangeMin + "," + qcs.RangeMax
222 257
 
223 258
 	} else {
224 259
 

+ 29 - 6
controllers/pc_index_evaluation_api_controller.go ファイルの表示

@@ -2,6 +2,7 @@ package controllers
2 2
 
3 3
 import (
4 4
 	"XT_New/enums"
5
+	"XT_New/models"
5 6
 	"XT_New/service/statistics_service"
6 7
 	"XT_New/utils"
7 8
 	"github.com/astaxie/beego"
@@ -51,7 +52,20 @@ type PCIndexEvaluationApiController struct {
51 52
 //初始化数据
52 53
 func (this *PCIndexEvaluationApiController) GetLaboratoryIndexInitData() {
53 54
 	adminUserInfo := this.GetAdminUserInfo()
54
-	references, _ := statistics_service.FindOrgQualityControlStandardInspectionReference(adminUserInfo.CurrentOrgId)
55
+
56
+	var references []*models.InspectionReference
57
+	count, _ := statistics_service.FindOrgInspectionCount(adminUserInfo.CurrentOrgId)
58
+	if count <= 0 {
59
+		references, _ = statistics_service.FindOrgInspectionReference(0, 1)
60
+		references2, _ := statistics_service.FindOrgInspectionReference(0, 2)
61
+		references = append(references, references2...)
62
+
63
+	} else {
64
+		references, _ = statistics_service.FindOrgInspectionReference(adminUserInfo.CurrentOrgId, 1)
65
+		references2, _ := statistics_service.FindOrgInspectionReference(adminUserInfo.CurrentOrgId, 2)
66
+		references = append(references, references2...)
67
+
68
+	}
55 69
 	this.ServeSuccessJSON(map[string]interface{}{
56 70
 		"references": references,
57 71
 	})
@@ -64,10 +78,19 @@ func (this *PCIndexEvaluationApiController) GetLaboratoryIndexProjectRangeValueD
64 78
 	item_id, _ := this.GetInt64("item_id")
65 79
 	adminUserInfo := this.GetAdminUserInfo()
66 80
 	var range_vaule []string
81
+	var qcs models.InspectionReference
67 82
 	if range_type == 1 {
68
-		qcs, _ := statistics_service.FindOrgConfigRangeTypeValue(adminUserInfo.CurrentOrgId, project_id, item_id)
69
-		range_vaule = append(range_vaule, qcs.MinRange)
70
-		range_vaule = append(range_vaule, qcs.LargeRange)
83
+		count, _ := statistics_service.FindOrgInspectionCount(adminUserInfo.CurrentOrgId)
84
+
85
+		if count <= 0 {
86
+			qcs, _ = statistics_service.FindOrgConfigRangeTypeValue(0, project_id, item_id)
87
+		} else {
88
+			qcs, _ = statistics_service.FindOrgConfigRangeTypeValue(adminUserInfo.CurrentOrgId, project_id, item_id)
89
+
90
+		}
91
+
92
+		range_vaule = append(range_vaule, qcs.RangeMin)
93
+		range_vaule = append(range_vaule, qcs.RangeMax)
71 94
 
72 95
 	} else {
73 96
 
@@ -113,7 +136,7 @@ func (this *PCIndexEvaluationApiController) GetInspectionChartData() {
113 136
 	var range_value string
114 137
 	if range_type == 1 {
115 138
 		qcs, _ := statistics_service.FindOrgConfigRangeTypeValue(adminUserInfo.CurrentOrgId, project_id, item_id)
116
-		range_value = qcs.MinRange + "," + qcs.LargeRange
139
+		range_value = qcs.RangeMin + "," + qcs.RangeMax
117 140
 
118 141
 	} else {
119 142
 		inspection, _ := statistics_service.FindOrgInspectionReferenceRangeTypeValue(adminUserInfo.CurrentOrgId, project_id, item_id)
@@ -246,7 +269,7 @@ func (this *PCIndexEvaluationApiController) GetPatientInspectionBarChartData() {
246 269
 	var range_value string
247 270
 	if range_type == 1 {
248 271
 		qcs, _ := statistics_service.FindOrgConfigRangeTypeValue(adminUserInfo.CurrentOrgId, project_id, item_id)
249
-		range_value = qcs.MinRange + "," + qcs.LargeRange
272
+		range_value = qcs.RangeMin + "," + qcs.RangeMax
250 273
 
251 274
 	} else {
252 275
 		inspection, _ := statistics_service.FindOrgInspectionReferenceRangeTypeValue(adminUserInfo.CurrentOrgId, project_id, item_id)

+ 15 - 0
controllers/schedule_api_controller.go ファイルの表示

@@ -570,9 +570,24 @@ func (this *ScheduleApiController) PrintInitData() {
570 570
 		return
571 571
 	}
572 572
 
573
+	thisTime := time.Now()
574
+
575
+	weekDay := int(thisTime.Weekday())
576
+	if weekDay == 0 {
577
+		weekDay = 7
578
+	}
579
+	weekEnd := 7 - weekDay
580
+	weekStart := weekEnd - 6
581
+	days := make([]string, 0)
582
+	for index := weekStart; index <= weekEnd; index++ {
583
+		theDay := thisTime.AddDate(0, 0, index)
584
+		days = append(days, theDay.Format("2006-01-02"))
585
+	}
586
+
573 587
 	this.ServeSuccessJSON(map[string]interface{}{
574 588
 		"schedules": schedules,
575 589
 		"monday":    monday.Unix(),
590
+		"days":      days,
576 591
 	})
577 592
 }
578 593
 

+ 5 - 16
models/dialysis.go ファイルの表示

@@ -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 ファイルの表示

@@ -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 ファイルの表示

@@ -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 ファイルの表示

@@ -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

+ 8 - 2
service/statistics_service/index_evaluation_service.go ファイルの表示

@@ -1431,9 +1431,9 @@ func FindOrgInspectionReferenceRangeTypeValue(user_org_id int64, project_id int6
1431 1431
 	return
1432 1432
 }
1433 1433
 
1434
-func FindOrgConfigRangeTypeValue(user_org_id int64, project_id int64, item_id int64) (qcs QualityControlStandard, err error) {
1434
+func FindOrgConfigRangeTypeValue(user_org_id int64, project_id int64, item_id int64) (qcs models.InspectionReference, err error) {
1435 1435
 	db := service.XTReadDB()
1436
-	err = db.Model(&QualityControlStandard{}).Where("status = 1 AND user_org_id = ? AND inspection_major = ? AND inspection_minor = ?", user_org_id, project_id, item_id).First(&qcs).Error
1436
+	err = db.Model(&models.InspectionReference{}).Where("status = 1 AND org_id = ? AND project_id = ? AND id = ?", user_org_id, project_id, item_id).First(&qcs).Error
1437 1437
 	return
1438 1438
 }
1439 1439
 
@@ -1769,3 +1769,9 @@ func FindOrgQualityControlStandardInspectionReferenceById(user_org_id int64, pro
1769 1769
 	err = db.Raw("Select reference.project_name as project_name,qcs.inspection_major as project_id, qcs.inspection_minor as id,reference.item_name as item_name,qcs.range_type as range_type,reference.range_min as range_min, reference.range_max as range_max,reference.unit as  unit,qcs.range_value as range_value   from xt_quality_control_standard qcs Left JOIN xt_inspection_reference reference ON  qcs.inspection_major = reference.project_id and qcs.inspection_minor = reference.id and  (reference.org_id = ? OR org_id = 0)  Where qcs.user_org_id = ?  AND qcs.status = 1 AND qcs.inspection_major = ? AND qcs.inspection_minor = ?", user_org_id, user_org_id, project_id, item_id).Scan(&references).Error
1770 1770
 	return
1771 1771
 }
1772
+
1773
+func FindOrgInspectionCount(user_org_id int64) (count int64, err error) {
1774
+	db := service.XTReadDB()
1775
+	err = db.Model(&models.InspectionReference{}).Where("status = 1 AND org_id = ?", user_org_id).Count(&count).Error
1776
+	return
1777
+}