28169 пре 2 недеља
родитељ
комит
d3e700b12b

+ 4 - 4
controllers/base_api_controller.go Прегледај датотеку

@@ -83,7 +83,7 @@ func (this *BaseAuthAPIController) Prepare() {
83 83
 		userAdmin.ModifyTime = 1530786071
84 84
 		var subscibe models.ServeSubscibe
85 85
 		subscibe.ID = 11
86
-		subscibe.OrgId = 10702 //机构id
86
+		subscibe.OrgId = 10164 //机构id
87 87
 		subscibe.PeriodStart = 1547447814
88 88
 		subscibe.PeriodEnd = 1550039814
89 89
 		subscibe.State = 1
@@ -93,7 +93,7 @@ func (this *BaseAuthAPIController) Prepare() {
93 93
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
94 94
 		subscibes[4] = &subscibe
95 95
 		var adminUserInfo service.AdminUserInfo
96
-		adminUserInfo.CurrentOrgId = 10702 //机构id小英9675或4
96
+		adminUserInfo.CurrentOrgId = 10164 //机构id小英9675或4
97 97
 		adminUserInfo.CurrentAppId = 12123 //4
98 98
 		adminUserInfo.AdminUser = &userAdmin
99 99
 		adminUserInfo.Subscibes = subscibes
@@ -329,7 +329,7 @@ func (this *BaseServeAPIController) Prepare() {
329 329
 		userAdmin.ModifyTime = 1530786071
330 330
 		var subscibe models.ServeSubscibe
331 331
 		subscibe.ID = 11
332
-		subscibe.OrgId = 10702 //机构id小英9675或4
332
+		subscibe.OrgId = 10164 //机构id小英9675或4
333 333
 		subscibe.PeriodStart = 1538035409
334 334
 		subscibe.PeriodEnd = 1569571409
335 335
 		subscibe.State = 1
@@ -339,7 +339,7 @@ func (this *BaseServeAPIController) Prepare() {
339 339
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
340 340
 		subscibes[4] = &subscibe
341 341
 		var adminUserInfo service.AdminUserInfo
342
-		adminUserInfo.CurrentOrgId = 10702 //机构id小英9675或4
342
+		adminUserInfo.CurrentOrgId = 10164 //机构id小英9675或4
343 343
 		adminUserInfo.CurrentAppId = 12123 //4
344 344
 		adminUserInfo.AdminUser = &userAdmin
345 345
 		adminUserInfo.Subscibes = subscibes

+ 11 - 0
controllers/data_api_controller.go Прегледај датотеку

@@ -1023,6 +1023,10 @@ func (c *DataApiController) CreateAdviceTemplate() {
1023 1023
 
1024 1024
 				way := int64(items["way"].(float64))
1025 1025
 
1026
+				remark := items["remark"].(string)
1027
+
1028
+				fmt.Println("remark--------------------------", remark)
1029
+
1026 1030
 				subTemps := &models.DoctorAdviceTemplate{
1027 1031
 					AdviceName:            advice_name,
1028 1032
 					Status:                1,
@@ -1047,6 +1051,7 @@ func (c *DataApiController) CreateAdviceTemplate() {
1047 1051
 					Way:                   way,
1048 1052
 					DrugId:                drug_id,
1049 1053
 					DrugNameId:            0,
1054
+					Remark:                remark,
1050 1055
 				}
1051 1056
 				subTemplate = append(subTemplate, subTemps)
1052 1057
 
@@ -1128,6 +1133,8 @@ func (c *DataApiController) UpdateAdviceTemplate() {
1128 1133
 	template.DrugId = template.DrugId
1129 1134
 	template.Way = template.Way
1130 1135
 
1136
+	template.Remark = templatedata.Remark
1137
+
1131 1138
 	err = service.UpdateAdviceTemplate(template)
1132 1139
 	if err != nil {
1133 1140
 		utils.ErrorLog("%v", err)
@@ -1295,6 +1302,7 @@ func (c *DataApiController) DeleteParentAdviceTemplate() {
1295 1302
 }
1296 1303
 
1297 1304
 func (c *DataApiController) CreateSubAdviceTemplate() {
1305
+
1298 1306
 	drug_spec := c.GetString("drug_spec")
1299 1307
 	drug_spec_unit := c.GetString("drug_spec_unit")
1300 1308
 	advice_name := c.GetString("advice_name")
@@ -1309,6 +1317,8 @@ func (c *DataApiController) CreateSubAdviceTemplate() {
1309 1317
 	parent_id, _ := c.GetInt64("parent_id", 0)
1310 1318
 	drug_id, _ := c.GetInt64("drug_id")
1311 1319
 	way, _ := c.GetInt64("way")
1320
+	remark := c.GetString("remark")
1321
+
1312 1322
 	adminUserInfo := c.GetAdminUserInfo()
1313 1323
 
1314 1324
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
@@ -1343,6 +1353,7 @@ func (c *DataApiController) CreateSubAdviceTemplate() {
1343 1353
 		ParentId:              parent_id,
1344 1354
 		DrugId:                drug_id,
1345 1355
 		Way:                   way,
1356
+		Remark:                remark,
1346 1357
 	}
1347 1358
 
1348 1359
 	if template.AdviceName == "" {

+ 2 - 0
controllers/mobile_api_controllers/dialysis_api_controller.go Прегледај датотеку

@@ -3329,6 +3329,8 @@ func (c *DialysisAPIController) Finish() {
3329 3329
 		tempassessmentAfterDislysis.SystolicBloodPressure = 0
3330 3330
 	}
3331 3331
 
3332
+	tempassessmentAfterDislysis.RecordTime = dialysisOrder.EndTime
3333
+
3332 3334
 	err := service.UpdateAssessmentAfterDislysisRecord(&tempassessmentAfterDislysis)
3333 3335
 
3334 3336
 	key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_after_dislysis"

+ 1 - 1
controllers/mobile_api_controllers/patient_api_controller.go Прегледај датотеку

@@ -7082,7 +7082,7 @@ func (c *PatientApiController) CheckProject() {
7082 7082
 			for _, items := range ps {
7083 7083
 				ids = append(ids, items.ID)
7084 7084
 			}
7085
-			err := service.UpdateTeamProjectCheckStatus(ids, project.PatientId, project.RecordDate, project.UserOrgId, adminInfo.AdminUser.Id, time.Now().Unix())
7085
+			err := service.UpdateTeamProjectCheckStatus(ids, patient_id, record_date, adminInfo.Org.Id, adminInfo.AdminUser.Id, time.Now().Unix())
7086 7086
 			if err == nil {
7087 7087
 				c.ServeSuccessJSON(map[string]interface{}{
7088 7088
 					"project": project,

+ 112 - 1
controllers/patient_api_controller.go Прегледај датотеку

@@ -202,6 +202,14 @@ func PatientApiRegistRouters() {
202 202
 
203 203
 	beego.Router("/api/patient/deletecourestempalte", &PatientApiController{}, "Get:DeleteCouseTemplate")
204 204
 
205
+	beego.Router("/api/patient/getautopatientcontent", &PatientApiController{}, "Get:GetAutoPatientContent")
206
+
207
+	beego.Router("/api/patient/getpatientrescuerecord", &PatientApiController{}, "Get:GetPatientRescueRecord")
208
+
209
+	beego.Router("/api/patient/modifycourseprint", &PatientApiController{}, "Post:ModifyCoursePrint")
210
+
211
+	beego.Router("/api/patient/getpatientrescuerecordlist", &PatientApiController{}, "Get:GetPatientRescureRecordList")
212
+
205 213
 }
206 214
 func (c *PatientApiController) GetExportList() {
207 215
 	startTime := c.GetString("start_time")
@@ -8518,7 +8526,6 @@ func (this *PatientApiController) DeleteCouseTemplate() {
8518 8526
 
8519 8527
 	id, _ := this.GetInt64("id")
8520 8528
 
8521
-	fmt.Println("id==================", id)
8522 8529
 	service.DeleteCouseTemplate(id)
8523 8530
 
8524 8531
 	this.ServeSuccessJSON(map[string]interface{}{
@@ -8526,3 +8533,107 @@ func (this *PatientApiController) DeleteCouseTemplate() {
8526 8533
 	})
8527 8534
 
8528 8535
 }
8536
+
8537
+func (this *PatientApiController) GetAutoPatientContent() {
8538
+
8539
+	timeLayout := "2006-01-02"
8540
+	loc, _ := time.LoadLocation("Local")
8541
+
8542
+	start_time := this.GetString("start_time")
8543
+	end_time := this.GetString("end_time")
8544
+	patient_id, _ := this.GetInt64("patient_id")
8545
+
8546
+	fmt.Println("patinet_id ===========================", patient_id)
8547
+	orgId := this.GetAdminUserInfo().CurrentOrgId
8548
+	var startTime int64
8549
+	if len(start_time) > 0 {
8550
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
8551
+		if err != nil {
8552
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
8553
+			return
8554
+		}
8555
+		startTime = theTime.Unix()
8556
+	}
8557
+
8558
+	var endTime int64
8559
+	if len(end_time) > 0 {
8560
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 00:00:00", loc)
8561
+		if err != nil {
8562
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
8563
+			return
8564
+		}
8565
+		endTime = theTime.Unix()
8566
+	}
8567
+
8568
+	//获取透析处方
8569
+	prescription, _ := service.GetAutoDialysisPrescription(patient_id, startTime, endTime, orgId)
8570
+
8571
+	berfor, _ := service.GetAutoAssessmentBefor(patient_id, startTime, endTime, orgId)
8572
+
8573
+	monitorList, _ := service.GetAutoMonitorList(patient_id, startTime, endTime, orgId)
8574
+
8575
+	dryweightList, _ := service.GetAutoPatientDryWeight(patient_id, startTime, endTime, orgId)
8576
+
8577
+	inpectionList, _ := service.GetAutoInspectionList(patient_id, startTime, endTime, orgId)
8578
+
8579
+	dialysisOrder, _ := service.GetAutoDialysisOrder(patient_id, startTime, endTime, orgId)
8580
+
8581
+	patient, _ := service.GetPatientByIDOne(orgId, patient_id)
8582
+
8583
+	this.ServeSuccessJSON(map[string]interface{}{
8584
+		"prescription":  prescription,
8585
+		"berfor":        berfor,
8586
+		"monitorList":   monitorList,
8587
+		"dryweightList": dryweightList,
8588
+		"inpectionList": inpectionList,
8589
+		"dialysisOrder": dialysisOrder,
8590
+		"patient":       patient,
8591
+	})
8592
+
8593
+}
8594
+
8595
+func (this *PatientApiController) GetPatientRescueRecord() {
8596
+
8597
+	id, _ := this.GetInt64("id")
8598
+
8599
+	rescueRecord, _ := service.GetPatientRescueRecord(id)
8600
+
8601
+	this.ServeSuccessJSON(map[string]interface{}{
8602
+		"rescueRecord": rescueRecord,
8603
+	})
8604
+}
8605
+
8606
+func (this *PatientApiController) ModifyCoursePrint() {
8607
+
8608
+	dataBody := make(map[string]interface{}, 0)
8609
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
8610
+	fmt.Println("err", err)
8611
+	id := int64(dataBody["id"].(float64))
8612
+	content := dataBody["content"].(string)
8613
+
8614
+	coursePrint, _ := service.ModifyCoursePrint(id, content)
8615
+
8616
+	this.ServeSuccessJSON(map[string]interface{}{
8617
+		"coursePrint": coursePrint,
8618
+	})
8619
+}
8620
+
8621
+func (this *PatientApiController) GetPatientRescureRecordList() {
8622
+
8623
+	id, _ := this.GetInt64("id")
8624
+	patient_id, _ := this.GetInt64("patient_id")
8625
+
8626
+	orgId := this.GetAdminUserInfo().CurrentOrgId
8627
+	appId := this.GetAdminUserInfo().CurrentAppId
8628
+	patient, _ := service.GetPatientByIDOne(orgId, patient_id)
8629
+
8630
+	rescueRecordList, _ := service.GetPatientRescureRecordList(id)
8631
+
8632
+	operators, _ := service.GetAdminUserEsTwo(orgId, appId)
8633
+
8634
+	this.ServeSuccessJSON(map[string]interface{}{
8635
+		"rescueRecordList": rescueRecordList,
8636
+		"patient":          patient,
8637
+		"operators":        operators,
8638
+	})
8639
+}

+ 1 - 0
models/device_models.go Прегледај датотеку

@@ -1000,6 +1000,7 @@ type XtAssessmentAfterDislysis struct {
1000 1000
 	SealingFluidDispose             string  `gorm:"column:sealing_fluid_dispose" json:"sealing_fluid_dispose" form:"sealing_fluid_dispose"`
1001 1001
 	Ktv                             string  `gorm:"column:ktv" json:"ktv" form:"ktv"`
1002 1002
 	Urr                             string  `gorm:"column:urr" json:"urr" form:"urr"`
1003
+	RecordTime                      int64   `gorm:"column:record_time" json:"record_time" form:"record_time"`
1003 1004
 }
1004 1005
 
1005 1006
 func (XtAssessmentAfterDislysis) TableName() string {

+ 1 - 0
models/doctor_advice_models.go Прегледај датотеку

@@ -78,6 +78,7 @@ type DoctorAdviceTemplate struct {
78 78
 	Way                     int64                   `gorm:"column:way" json:"way" form:"way"`
79 79
 	DrugNameId              int64                   `gorm:"column:drug_name_id" json:"drug_name_id" form:"drug_name_id"`
80 80
 	SubDoctorAdviceTemplate []*DoctorAdviceTemplate `gorm:"ForeignKey:ParentId;AssociationForeignKey:ID" json:"child"`
81
+	Remark                  string                  `gorm:"column:remark" json:"remark" form:"remark"`
81 82
 }
82 83
 
83 84
 func (DoctorAdviceTemplate) TableName() string {

+ 135 - 0
models/patient_models.go Прегледај датотеку

@@ -2880,3 +2880,138 @@ func (XtDeathRecord) TableName() string {
2880 2880
 
2881 2881
 	return "xt_death_record"
2882 2882
 }
2883
+
2884
+type XtAutoDialysisPrescription struct {
2885
+	ID                         int64   `gorm:"column:id" json:"id" form:"id"`
2886
+	UserOrgId                  int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2887
+	PatientId                  int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
2888
+	Dialyzer                   int64   `gorm:"column:dialyzer" json:"dialyzer" form:"dialyzer"`
2889
+	MachineType                string  `gorm:"column:machine_type" json:"machine_type" form:"machine_type"`
2890
+	DewaterAmount              float64 `gorm:"column:dewater_amount" json:"dewater_amount" form:"dewater_amount"`
2891
+	DialyzerPerfusionApparatus string  `gorm:"column:dialyzer_perfusion_apparatus" json:"dialyzer_perfusion_apparatus" form:"dialyzer_perfusion_apparatus"`
2892
+	PrescriptionDewatering     float64 `gorm:"column:prescription_dewatering" json:"prescription_dewatering" form:"prescription_dewatering"`
2893
+	Anticoagulant              int64   `gorm:"column:anticoagulant" json:"anticoagulant" form:"anticoagulant"`
2894
+	AnticoagulantShouji        float64 `gorm:"column:anticoagulant_shouji" json:"anticoagulant_shouji" form:"anticoagulant_shouji"`
2895
+	AnticoagulantWeichi        float64 `gorm:"column:anticoagulant_weichi" json:"anticoagulant_weichi" form:"anticoagulant_weichi"`
2896
+	AnticoagulantZongliang     float64 `gorm:"column:anticoagulant_zongliang" json:"anticoagulant_zongliang" form:"anticoagulant_zongliang"`
2897
+	AnticoagulantGaimingcheng  string  `gorm:"column:anticoagulant_gaimingcheng" json:"anticoagulant_gaimingcheng" form:"anticoagulant_gaimingcheng"`
2898
+	AnticoagulantGaijiliang    string  `gorm:"column:anticoagulant_gaijiliang" json:"anticoagulant_gaijiliang" form:"anticoagulant_gaijiliang"`
2899
+	ModeId                     int64   `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
2900
+	DialysisDurationHour       int64   `gorm:"column:dialysis_duration_hour" json:"dialysis_duration_hour" form:"dialysis_duration_hour"`
2901
+	DialysisDurationMinute     int64   `gorm:"column:dialysis_duration_minute" json:"dialysis_duration_minute" form:"dialysis_duration_minute"`
2902
+	DialysisDuration           float64 `gorm:"column:dialysis_duration" json:"dialysis_duration" form:"dialysis_duration"`
2903
+	ReplacementTotal           float64 `gorm:"column:replacement_total" json:"replacement_total" form:"replacement_total"`
2904
+	ReplacementWay             int64   `gorm:"column:replacement_way" json:"replacement_way" form:"replacement_way"`
2905
+	HemodialysisMachine        int64   `gorm:"column:hemodialysis_machine" json:"hemodialysis_machine" form:"hemodialysis_machine"`
2906
+	BloodFilter                int64   `gorm:"column:blood_filter" json:"blood_filter" form:"blood_filter"`
2907
+	PerfusionApparatus         int64   `gorm:"column:perfusion_apparatus" json:"perfusion_apparatus" form:"perfusion_apparatus"`
2908
+	DryWeight                  float64 `gorm:"column:dry_weight" json:"dry_weight" form:"dry_weight"`
2909
+	VascularAccessMode         int64   `gorm:"column:vascular_access_mode" json:"vascular_access_mode" form:"vascular_access_mode"`
2910
+	VascularAccess             int64   `gorm:"column:vascular_access" json:"vascular_access" form:"vascular_access"`
2911
+	BloodFlowVolume            float64 `gorm:"column:blood_flow_volume" json:"blood_flow_volume" form:"blood_flow_volume"`
2912
+	DialysateFlow              float64 `gorm:"column:dialysate_flow" json:"dialysate_flow" form:"dialysate_flow"`
2913
+	DisplaceLiqui              float64 `gorm:"column:displace_liqui" json:"displace_liqui" form:"displace_liqui"`
2914
+	Kalium                     float64 `gorm:"column:kalium" json:"kalium" form:"kalium"`
2915
+	Sodium                     float64 `gorm:"column:sodium" json:"sodium" form:"sodium"`
2916
+	Calcium                    float64 `gorm:"column:calcium" json:"calcium" form:"calcium"`
2917
+	Bicarbonate                float64 `gorm:"column:bicarbonate" json:"bicarbonate" form:"bicarbonate"`
2918
+	Glucose                    float64 `gorm:"column:glucose" json:"glucose" form:"glucose"`
2919
+	DialysateTemperature       float64 `gorm:"column:dialysate_temperature" json:"dialysate_temperature" form:"dialysate_temperature"`
2920
+	Conductivity               float64 `gorm:"column:conductivity" json:"conductivity" form:"conductivity"`
2921
+	PrescriptionDoctor         int64   `gorm:"column:prescription_doctor" json:"prescription_doctor" form:"prescription_doctor"`
2922
+	Creater                    int64   `gorm:"column:creater" json:"creater" form:"creater"`
2923
+	Modifier                   int64   `gorm:"column:modifier" json:"modifier" form:"modifier"`
2924
+	Remark                     string  `gorm:"column:remark" json:"remark" form:"remark"`
2925
+	Status                     int64   `gorm:"column:status" json:"status" form:"status"`
2926
+	CreatedTime                int64   `gorm:"column:created_time" json:"created_time" form:"created_time"`
2927
+	UpdatedTime                int64   `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
2928
+	RecordDate                 int64   `gorm:"column:record_date" json:"record_date" form:"record_date"`
2929
+	RecordId                   int64   `gorm:"column:record_id" json:"record_id" form:"record_id"`
2930
+	TargetUltrafiltration      float64 `gorm:"column:target_ultrafiltration" json:"target_ultrafiltration" form:"target_ultrafiltration"`
2931
+	DialysateFormulation       int64   `gorm:"column:dialysate_formulation" json:"dialysate_formulation" form:"dialysate_formulation"`
2932
+	BodyFluid                  int64   `gorm:"column:body_fluid" json:"body_fluid" form:"body_fluid"`
2933
+	SpecialMedicine            int64   `gorm:"column:special_medicine" json:"special_medicine" form:"special_medicine"`
2934
+	SpecialMedicineOther       string  `gorm:"column:special_medicine_other" json:"special_medicine_other" form:"special_medicine_other"`
2935
+	DisplaceLiquiPart          int64   `gorm:"column:displace_liqui_part" json:"displace_liqui_part" form:"displace_liqui_part"`
2936
+	BloodAccess                int64   `gorm:"column:blood_access" json:"blood_access" form:"blood_access"`
2937
+	DisplaceLiquiValue         float64 `gorm:"column:displace_liqui_value" json:"displace_liqui_value" form:"displace_liqui_value"`
2938
+	Ultrafiltration            float64 `gorm:"column:ultrafiltration" json:"ultrafiltration" form:"ultrafiltration"`
2939
+	BodyFluidOther             string  `gorm:"column:body_fluid_other" json:"body_fluid_other" form:"body_fluid_other"`
2940
+	Niprocart                  int64   `gorm:"column:niprocart" json:"niprocart" form:"niprocart"`
2941
+	Jms                        int64   `gorm:"column:jms" json:"jms" form:"jms"`
2942
+	FistulaNeedleSet           int64   `gorm:"column:fistula_needle_set" json:"fistula_needle_set" form:"fistula_needle_set"`
2943
+	FistulaNeedleSet16         int64   `gorm:"column:fistula_needle_set_16" json:"fistula_needle_set_16" form:"fistula_needle_set_16"`
2944
+	Hemoperfusion              int64   `gorm:"column:hemoperfusion" json:"hemoperfusion" form:"hemoperfusion"`
2945
+	DialyserSterilised         int64   `gorm:"column:dialyser_sterilised" json:"dialyser_sterilised" form:"dialyser_sterilised"`
2946
+	Filtryzer                  int64   `gorm:"column:filtryzer" json:"filtryzer" form:"filtryzer"`
2947
+	TargetKtv                  float64 `gorm:"column:target_ktv" json:"target_ktv" form:"target_ktv"`
2948
+	Dialyzers                  int64   `gorm:"column:dialyzers" json:"dialyzers" form:"dialyzers"`
2949
+	Injector                   int64   `gorm:"column:injector" json:"injector" form:"injector"`
2950
+	Bloodlines                 int64   `gorm:"column:bloodlines" json:"bloodlines" form:"bloodlines"`
2951
+	TubingHemodialysis         int64   `gorm:"column:tubing_hemodialysis" json:"tubing_hemodialysis" form:"tubing_hemodialysis"`
2952
+	Package                    int64   `gorm:"column:package" json:"package" form:"package"`
2953
+	ALiquid                    int64   `gorm:"column:a_liquid" json:"a_liquid" form:"a_liquid"`
2954
+	PreImpulse                 string  `gorm:"column:pre_impulse" json:"pre_impulse" form:"pre_impulse"`
2955
+	AnticoagulantStopTimeHour  int64   `gorm:"column:anticoagulant_stop_time_hour" json:"anticoagulant_stop_time_hour" form:"anticoagulant_stop_time_hour"`
2956
+	AnticoagulantStopTimeMin   int64   `gorm:"column:anticoagulant_stop_time_min" json:"anticoagulant_stop_time_min" form:"anticoagulant_stop_time_min"`
2957
+	HeparinSodium              string  `gorm:"column:heparin_sodium" json:"heparin_sodium" form:"heparin_sodium"`
2958
+	Nucleoprotamine            string  `gorm:"column:nucleoprotamine" json:"nucleoprotamine" form:"nucleoprotamine"`
2959
+	PushTheProtamine           string  `gorm:"column:push_the_protamine" json:"push_the_protamine" form:"push_the_protamine"`
2960
+	NoHeparinRemarks           string  `gorm:"column:no_heparin_remarks" json:"no_heparin_remarks" form:"no_heparin_remarks"`
2961
+	Blood                      string  `gorm:"column:blood" json:"blood" form:"blood"`
2962
+	AntioxidantCommodityName   string  `gorm:"column:antioxidant_commodity_name" json:"antioxidant_commodity_name" form:"antioxidant_commodity_name"`
2963
+	DialysisDialyszers         string  `gorm:"column:dialysis_dialyszers" json:"dialysis_dialyszers" form:"dialysis_dialyszers"`
2964
+	DialysisIrrigation         string  `gorm:"column:dialysis_irrigation" json:"dialysis_irrigation" form:"dialysis_irrigation"`
2965
+	DisplaceSpeed              string  `gorm:"column:displace_speed" json:"displace_speed" form:"displace_speed"`
2966
+	Illness                    int64   `gorm:"column:illness" json:"illness" form:"illness"`
2967
+	Amylaceum                  string  `gorm:"column:amylaceum" json:"amylaceum" form:"amylaceum"`
2968
+	SingleTime                 string  `gorm:"column:single_time" json:"single_time" form:"single_time"`
2969
+	SingleWater                string  `gorm:"column:single_water" json:"single_water" form:"single_water"`
2970
+	ReplacementFlow            string  `gorm:"column:replacement_flow" json:"replacement_flow" form:"replacement_flow"`
2971
+	PlasmaSeparator            string  `gorm:"column:plasma_separator" json:"plasma_separator" form:"plasma_separator"`
2972
+	BilirubinAdsorptionColumn  string  `gorm:"column:bilirubin_adsorption_column" json:"bilirubin_adsorption_column" form:"bilirubin_adsorption_column"`
2973
+	OxygenUptake               int64   `gorm:"column:oxygen_uptake" json:"oxygen_uptake" form:"oxygen_uptake"`
2974
+	OxygenFlow                 string  `gorm:"column:oxygen_flow" json:"oxygen_flow" form:"oxygen_flow"`
2975
+	OxygenTime                 string  `gorm:"column:oxygen_time" json:"oxygen_time" form:"oxygen_time"`
2976
+	HemodialysisPipelines      string  `gorm:"column:hemodialysis_pipelines" json:"hemodialysis_pipelines" form:"hemodialysis_pipelines"`
2977
+	HemodialysisPipelinesCount float64 `gorm:"column:hemodialysis_pipelines_count" json:"hemodialysis_pipelines_count" form:"hemodialysis_pipelines_count"`
2978
+	PunctureNeedle             string  `gorm:"column:puncture_needle" json:"puncture_needle" form:"puncture_needle"`
2979
+	PunctureNeedleCount        float64 `gorm:"column:puncture_needle_count" json:"puncture_needle_count" form:"puncture_needle_count"`
2980
+	Epo                        string  `gorm:"column:epo" json:"epo" form:"epo"`
2981
+	EpoCount                   float64 `gorm:"column:epo_count" json:"epo_count" form:"epo_count"`
2982
+	MaxUltrafiltrationRate     float64 `gorm:"column:max_ultrafiltration_rate" json:"max_ultrafiltration_rate" form:"max_ultrafiltration_rate"`
2983
+	AdminUserId                int64   `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
2984
+	DrhyWater                  string  `gorm:"column:drhy_water" json:"drhy_water" form:"drhy_water"`
2985
+	IsWater                    int64   `gorm:"column:is_water" json:"is_water" form:"is_water"`
2986
+	DryWaterHour               string  `gorm:"column:dry_water_hour" json:"dry_water_hour" form:"dry_water_hour"`
2987
+	WaterMachine               string  `gorm:"column:water_machine" json:"water_machine" form:"water_machine"`
2988
+	AddAmount                  float64 `gorm:"column:add_amount" json:"add_amount" form:"add_amount"`
2989
+	ReduceAmount               float64 `gorm:"column:reduce_amount" json:"reduce_amount" form:"reduce_amount"`
2990
+	DialysisRemark             string  `gorm:"column:dialysis_remark" json:"dialysis_remark" form:"dialysis_remark"`
2991
+	PrescribingNumber          float64 `gorm:"column:prescribing_number" json:"prescribing_number" form:"prescribing_number"`
2992
+	TreatmentRemark            string  `gorm:"column:treatment_remark" json:"treatment_remark" form:"treatment_remark"`
2993
+	PrescriptionSodium         string  `gorm:"column:prescription_sodium" json:"prescription_sodium" form:"prescription_sodium"`
2994
+	StartSodium                string  `gorm:"column:start_sodium" json:"start_sodium" form:"start_sodium"`
2995
+	SodiumCurve                string  `gorm:"column:sodium_curve" json:"sodium_curve" form:"sodium_curve"`
2996
+	DialysisFluidFlow          string  `gorm:"column:dialysis_fluid_flow" json:"dialysis_fluid_flow" form:"dialysis_fluid_flow"`
2997
+	SodiumBicarbonateFlow      string  `gorm:"column:sodium_bicarbonate_flow" json:"sodium_bicarbonate_flow" form:"sodium_bicarbonate_flow"`
2998
+	PrescriptionWater          float64 `gorm:"column:prescription_water" json:"prescription_water" form:"prescription_water"`
2999
+	DialysisStrainer           string  `gorm:"column:dialysis_strainer" json:"dialysis_strainer" form:"dialysis_strainer"`
3000
+	Chaptalization             string  `gorm:"column:chaptalization" json:"chaptalization" form:"chaptalization"`
3001
+	WarshCount                 string  `gorm:"column:warsh_count" json:"warsh_count" form:"warsh_count"`
3002
+	WashingTime                string  `gorm:"column:washing_time" json:"washing_time" form:"washing_time"`
3003
+	BloodAccessPartId          string  `gorm:"column:blood_access_part_id" json:"blood_access_part_id" form:"blood_access_part_id"`
3004
+	AnticoagulantWeichiHour    string  `gorm:"column:anticoagulant_weichi_hour" json:"anticoagulant_weichi_hour" form:"anticoagulant_weichi_hour"`
3005
+	Dialyzate                  string  `gorm:"column:dialyzate" json:"dialyzate" form:"dialyzate"`
3006
+	DialysisDialyszersId       int64   `gorm:"column:dialysis_dialyszers_id" json:"dialysis_dialyszers_id" form:"dialysis_dialyszers_id"`
3007
+	DialysisStrainerId         int64   `gorm:"column:dialysis_strainer_id" json:"dialysis_strainer_id" form:"dialysis_strainer_id"`
3008
+	DialysisIrrigationId       int64   `gorm:"column:dialysis_irrigation_id" json:"dialysis_irrigation_id" form:"dialysis_irrigation_id"`
3009
+	FirstSuper                 int64   `gorm:"column:first_super" json:"first_super" form:"first_super"`
3010
+	IsSequential               int64   `gorm:"column:is_sequential" json:"is_sequential" form:"is_sequential"`
3011
+	Conduct                    string  `gorm:"column:conduct" json:"conduct" form:"conduct"`
3012
+}
3013
+
3014
+func (XtAutoDialysisPrescription) TableName() string {
3015
+
3016
+	return "xt_dialysis_prescription"
3017
+}

+ 4 - 3
service/doctor_advice_service.go Прегледај датотеку

@@ -237,11 +237,11 @@ func CreateSubTemplate(template []*models.DoctorAdviceTemplate) (err error) {
237 237
 		utx := writeDb.Begin()
238 238
 		if len(template) > 0 {
239 239
 			thisSQL := "INSERT INTO xt_doctor_advice_template (org_id, advice_name, advice_desc, single_dose, single_dose_unit,prescribing_number," +
240
-				"prescribing_number_unit,delivery_way,execution_frequency,advice_doctor,status,created_time,updated_time,template_id,drug_spec,drug_spec_unit,advice_type,day_count,week_days,frequency_type,drug_id,way) VALUES "
240
+				"prescribing_number_unit,delivery_way,execution_frequency,advice_doctor,status,created_time,updated_time,template_id,drug_spec,drug_spec_unit,advice_type,day_count,week_days,frequency_type,drug_id,way,remark) VALUES "
241 241
 			insertParams := make([]string, 0)
242 242
 			insertData := make([]interface{}, 0)
243 243
 			for _, info := range template {
244
-				insertParams = append(insertParams, "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)")
244
+				insertParams = append(insertParams, "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)")
245 245
 				insertData = append(insertData, info.OrgId)
246 246
 				insertData = append(insertData, info.AdviceName)
247 247
 				insertData = append(insertData, info.AdviceDesc)
@@ -264,6 +264,7 @@ func CreateSubTemplate(template []*models.DoctorAdviceTemplate) (err error) {
264 264
 				insertData = append(insertData, info.FrequencyType)
265 265
 				insertData = append(insertData, info.DrugId)
266 266
 				insertData = append(insertData, info.Way)
267
+				insertData = append(insertData, info.Remark)
267 268
 			}
268 269
 			thisSQL += strings.Join(insertParams, ", ")
269 270
 			err = utx.Exec(thisSQL, insertData...).Error
@@ -373,7 +374,7 @@ func ModifyHisTemplateName(id int64, template_name string) (err error) {
373 374
 
374 375
 func FindOtherAllAdviceTemplate(org_id int64) (temps []*models.DoctorAdviceParentTemplate, err error) {
375 376
 	err = readDb.Model(&models.DoctorAdviceParentTemplate{}).Preload("DoctorAdviceTemplate", func(db *gorm.DB) *gorm.DB {
376
-		return db.Select("id,advice_name,advice_desc,single_dose,single_dose_unit,prescribing_number,prescribing_number_unit,delivery_way,execution_frequency,status,created_time,updated_time,parent_id,template_id,drug_spec,drug_spec_unit,advice_type,day_count,week_days,frequency_type,drug_id,way, IF(parent_id>0, parent_id, id) as advice_order").Where("status = 1").Order("advice_order desc, id")
377
+		return db.Select("id,advice_name,advice_desc,single_dose,single_dose_unit,prescribing_number,prescribing_number_unit,delivery_way,execution_frequency,status,created_time,updated_time,parent_id,template_id,drug_spec,drug_spec_unit,advice_type,day_count,week_days,frequency_type,drug_id,way,remark, IF(parent_id>0, parent_id, id) as advice_order").Where("status = 1").Order("advice_order desc, id")
377 378
 	}).Where("org_id = ? AND status=1 ", org_id).Find(&temps).Error
378 379
 	return
379 380
 	//.Scan(&advices).Error

+ 151 - 0
service/patient_service.go Прегледај датотеку

@@ -4537,3 +4537,154 @@ func DeleteCouseTemplate(id int64) error {
4537 4537
 
4538 4538
 	return err
4539 4539
 }
4540
+
4541
+func GetAutoDialysisPrescription(patient_id int64, start_time int64, end_time int64, org_id int64) (prescription []*models.XtAutoDialysisPrescription, err error) {
4542
+
4543
+	db := XTReadDB().Model(&prescription).Where("status=1")
4544
+
4545
+	if patient_id > 0 {
4546
+		db = db.Where("patient_id = ?", patient_id)
4547
+	}
4548
+
4549
+	if start_time > 0 {
4550
+		db = db.Where("record_date>=?", start_time)
4551
+	}
4552
+
4553
+	if end_time > 0 {
4554
+		db = db.Where("record_date<=?", end_time)
4555
+	}
4556
+	if org_id > 0 {
4557
+		db = db.Where("user_org_id = ?", org_id)
4558
+	}
4559
+	err = db.Find(&prescription).Error
4560
+	return prescription, err
4561
+}
4562
+
4563
+func GetAutoAssessmentBefor(patient_id int64, start_time int64, end_time int64, org_id int64) (berfor []*models.XtAssessmentBeforeDislysis, err error) {
4564
+
4565
+	db := XTReadDB().Model(&berfor).Where("status=1")
4566
+
4567
+	if patient_id > 0 {
4568
+		db = db.Where("patient_id = ?", patient_id)
4569
+	}
4570
+
4571
+	if start_time > 0 {
4572
+		db = db.Where("assessment_date>=?", start_time)
4573
+	}
4574
+
4575
+	if end_time > 0 {
4576
+		db = db.Where("assessment_date<=?", end_time)
4577
+	}
4578
+	if org_id > 0 {
4579
+		db = db.Where("user_org_id = ?", org_id)
4580
+	}
4581
+	err = db.Find(&berfor).Error
4582
+	return berfor, err
4583
+}
4584
+
4585
+func GetAutoMonitorList(patient_id int64, start_time int64, end_time int64, org_id int64) (monitor []*models.XTMonitoringRecord, err error) {
4586
+
4587
+	db := XTReadDB().Model(&monitor).Where("status=1")
4588
+
4589
+	if patient_id > 0 {
4590
+		db = db.Where("patient_id = ?", patient_id)
4591
+	}
4592
+
4593
+	if start_time > 0 {
4594
+		db = db.Where("monitoring_date>=?", start_time)
4595
+	}
4596
+
4597
+	if end_time > 0 {
4598
+		db = db.Where("monitoring_date<=?", end_time)
4599
+	}
4600
+	if org_id > 0 {
4601
+		db = db.Where("user_org_id = ?", org_id)
4602
+	}
4603
+	err = db.Find(&monitor).Error
4604
+	return monitor, err
4605
+}
4606
+
4607
+func GetAutoPatientDryWeight(patient_id int64, start_time int64, end_time int64, org_id int64) (dryweight []*models.SgjPatientDryweight, err error) {
4608
+
4609
+	db := XTReadDB().Model(&dryweight).Where("status=1")
4610
+
4611
+	if patient_id > 0 {
4612
+		db = db.Where("patient_id = ?", patient_id)
4613
+	}
4614
+
4615
+	if org_id > 0 {
4616
+		db = db.Where("user_org_id = ?", org_id)
4617
+	}
4618
+	err = db.Order("id asc").Find(&dryweight).Error
4619
+	return dryweight, err
4620
+}
4621
+
4622
+func GetAutoInspectionList(patient_id int64, start_time int64, end_time int64, org_id int64) (inpection []*models.XtInspection, err error) {
4623
+
4624
+	db := XTReadDB().Model(&inpection).Where("status=1")
4625
+
4626
+	if patient_id > 0 {
4627
+		db = db.Where("patient_id = ?", patient_id)
4628
+	}
4629
+
4630
+	if start_time > 0 {
4631
+		db = db.Where("inspect_date>=?", start_time)
4632
+	}
4633
+
4634
+	if end_time > 0 {
4635
+		db = db.Where("inspect_date<=?", end_time)
4636
+	}
4637
+	if org_id > 0 {
4638
+		db = db.Where("org_id = ?", org_id)
4639
+	}
4640
+	err = db.Find(&inpection).Error
4641
+	return inpection, err
4642
+}
4643
+
4644
+func GetPatientDialysisOrder(org_id int64) (order []*models.XtDialysisOrder, err error) {
4645
+
4646
+	err = XTReadDB().Where("user_org_id = ? and status=1 and dialysis_date<1733155200", org_id).Find(&order).Error
4647
+
4648
+	return order, err
4649
+}
4650
+
4651
+func UpdateAssesmentAfeter(patient_id int64, dialysis_date int64, end_time int64) (models.XtAssessmentAfterDislysis, error) {
4652
+
4653
+	dialysisOrder := models.XtAssessmentAfterDislysis{}
4654
+
4655
+	err := XTWriteDB().Model(&dialysisOrder).Where("patient_id = ? and assessment_date =? and status=1", patient_id, dialysis_date).Updates(map[string]interface{}{"record_time": end_time}).Error
4656
+
4657
+	return dialysisOrder, err
4658
+}
4659
+
4660
+func GetPatientRescueRecord(id int64) (models.XtPatientRescueRecord, error) {
4661
+
4662
+	rescueRecords := models.XtPatientRescueRecord{}
4663
+
4664
+	err := XTReadDB().Where("id = ? and status=1", id).Find(&rescueRecords).Error
4665
+
4666
+	return rescueRecords, err
4667
+}
4668
+
4669
+func ModifyCoursePrint(id int64, content string) (models.XtPatientRescueRecord, error) {
4670
+
4671
+	rescueRecord := models.XtPatientRescueRecord{}
4672
+
4673
+	err := XTWriteDB().Model(&rescueRecord).Where("id = ? and status=1", id).Updates(map[string]interface{}{"content": content}).Error
4674
+
4675
+	return rescueRecord, err
4676
+}
4677
+
4678
+func GetPatientRescureRecordList(id int64) (rescueRecord []*models.XtPatientRescueRecord, err error) {
4679
+
4680
+	err = XTWriteDB().Model(&rescueRecord).Where("id = ? and status=1", id).Find(&rescueRecord).Error
4681
+
4682
+	return rescueRecord, err
4683
+}
4684
+
4685
+func GetAutoDialysisOrder(patient_id int64, start_time int64, end_time int64, user_org_id int64) (order []*models.XtDialysisOrder, err error) {
4686
+
4687
+	err = XTReadDB().Where("patient_id = ? and dialysis_date>=? and dialysis_date<=? and user_org_id = ? and status=1", patient_id, start_time, end_time, user_org_id).Find(&order).Error
4688
+
4689
+	return order, err
4690
+}