Quellcode durchsuchen

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

csx vor 4 Jahren
Ursprung
Commit
6128b563eb

+ 7 - 1
controllers/dialysis_api_controller.go Datei anzeigen

@@ -3295,11 +3295,15 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
3295 3295
 		//
3296 3296
 
3297 3297
 		//新增逻辑
3298
+		templateInfo, _ := service.GetOrgInfoTemplate(adminUserInfo.CurrentOrgId)
3298 3299
 
3299 3300
 		var dewater_amount float64
3300 3301
 		dewater_amount = 0
3301 3302
 		if evaluation.DryWeight > 0 {
3302 3303
 			dewater_amount = evaluation.WeightBefore - evaluation.DryWeight - evaluation.AdditionalWeight
3304
+			if templateInfo.TemplateId == 17 {
3305
+				dewater_amount = dewater_amount * 1000
3306
+			}
3303 3307
 			if dewater_amount <= 0 {
3304 3308
 				dewater_amount = 0
3305 3309
 			}
@@ -4850,15 +4854,17 @@ func (this *DialysisApiController) GetTodayMonitor() {
4850 4854
 			totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
4851 4855
 			if template.TemplateId == 6 { //adminInfo.CurrentOrgId == 9538
4852 4856
 				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration / float64(totalMin) * 60 * 1000)
4857
+				record.UltrafiltrationRate = ultrafiltration_rate
4853 4858
 			}
4854 4859
 			// 只针对方济医院
4855 4860
 			if template.TemplateId == 1 {
4856 4861
 				value, _ := strconv.ParseFloat(fmt.Sprintf("%.3f", prescription.TargetUltrafiltration/float64(totalMin)*60), 6)
4857 4862
 				ultrafiltration_rate = value
4863
+				record.UltrafiltrationRate = ultrafiltration_rate
4858 4864
 			}
4859 4865
 		}
4860 4866
 	}
4861
-	record.UltrafiltrationRate = ultrafiltration_rate
4867
+	// record.UltrafiltrationRate = ultrafiltration_rate
4862 4868
 	record.UltrafiltrationVolume = 0
4863 4869
 	if template.TemplateId == 1 {
4864 4870
 		if ultrafiltration_rate > 0 {

+ 18 - 0
controllers/mobile_api_controllers/check_weight_api_controller.go Datei anzeigen

@@ -679,6 +679,24 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
679 679
 	}
680 680
 }
681 681
 
682
+func (c *CheckWeightApiController) GetPatientList() {
683
+	syncTime, _ := c.GetInt64("synctime", 0)
684
+	force, _ := c.GetInt64("force", 0)
685
+	adminUserInfo := c.GetMobileAdminUserInfo()
686
+	patientList, total, error := service.GetPatientListByUpdateTime(adminUserInfo.Org.Id, syncTime, force)
687
+	if error != nil {
688
+		c.ErrorLog("获取病人列表失败:%v", error)
689
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
690
+		return
691
+	}
692
+	serviceTime := time.Now().Unix()
693
+	c.ServeSuccessJSON(map[string]interface{}{
694
+		"patientlist": patientList,
695
+		"total":       total,
696
+		"servicetime": serviceTime,
697
+	})
698
+}
699
+
682 700
 func (c *CheckWeightApiController) GetPatientInfoDialysis() {
683 701
 	id, _ := c.GetInt64("patient", 0)
684 702
 	if id <= 0 {

+ 3 - 1
controllers/mobile_api_controllers/dialysis_api_controller.go Datei anzeigen

@@ -5534,15 +5534,17 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
5534 5534
 			totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
5535 5535
 			if template.TemplateId == 6 {
5536 5536
 				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration / float64(totalMin) * 60 * 1000)
5537
+				record.UltrafiltrationRate = ultrafiltration_rate
5537 5538
 			}
5538 5539
 			// 只针对方济医院
5539 5540
 			if template.TemplateId == 1 {
5540 5541
 				value, _ := strconv.ParseFloat(fmt.Sprintf("%.3f", prescription.TargetUltrafiltration/float64(totalMin)*60), 6)
5541 5542
 				ultrafiltration_rate = value
5543
+				record.UltrafiltrationRate = ultrafiltration_rate
5542 5544
 			}
5543 5545
 		}
5544 5546
 	}
5545
-	record.UltrafiltrationRate = ultrafiltration_rate
5547
+	// record.UltrafiltrationRate = ultrafiltration_rate
5546 5548
 	record.UltrafiltrationVolume = 0
5547 5549
 	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
5548 5550
 		if ultrafiltration_rate > 0 {

+ 1 - 0
controllers/mobile_api_controllers/mobile_api_router_register.go Datei anzeigen

@@ -11,6 +11,7 @@ func MobileAPIControllersRegisterRouters() {
11 11
 	// beego.Router("/m/api/test", &DialysisTestAPIController{}, "get:Test")
12 12
 	beego.Router("/m/api/savebloodpressure", &CheckWeightApiController{}, "Post:SaveBloodPressure")
13 13
 	beego.Router("/m/api/checkbeforedialysis", &CheckWeightApiController{}, "get:GetPatientInfoBeforeDialysis")
14
+	beego.Router("/m/api/getpatientlist", &CheckWeightApiController{}, "get:GetPatientList")
14 15
 	beego.Router("/m/api/checkdialysis", &CheckWeightApiController{}, "get:GetPatientInfoDialysis")
15 16
 	beego.Router("/m/api/savecheckdialysis", &CheckWeightApiController{}, "Post:SavePatientInfoDialysis")
16 17
 	beego.Router("/m/api/scheduals", &DialysisAPIController{}, "get:Scheduals")

+ 4 - 0
controllers/mobile_api_controllers/patient_api_controller.go Datei anzeigen

@@ -843,6 +843,7 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
843 843
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
844 844
 		return
845 845
 	}
846
+	template, _ := service.GetOrgInfoTemplate(adminUserInfo.Org.Id)
846 847
 	//templateInfo,_ := service.GetOrgInfoTemplate(adminUserInfo.Org.Id)
847 848
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
848 849
 	var evaluation models.PredialysisEvaluation
@@ -889,6 +890,9 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
889 890
 	dewater_amount = 0
890 891
 	if evaluation.DryWeight > 0 {
891 892
 		dewater_amount = evaluation.WeightBefore - evaluation.DryWeight - evaluation.AdditionalWeight
893
+		if template.TemplateId == 17 {
894
+			dewater_amount = dewater_amount * 1000
895
+		}
892 896
 		if dewater_amount <= 0 {
893 897
 			dewater_amount = 0
894 898
 		}

+ 17 - 0
models/patient_models.go Datei anzeigen

@@ -1,5 +1,22 @@
1 1
 package models
2 2
 
3
+type PatientListForFace struct {
4
+	ID          int64  `gorm:"column:id" json:"id" form:"id"`
5
+	UserOrgId   int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
6
+	Avatar      string `gorm:"column:avatar" json:"avatar" form:"avatar"`
7
+	DialysisNo  string `gorm:"column:dialysis_no" json:"dialysis_no" form:"dialysis_no"`
8
+	IdCardNo    string `gorm:"column:id_card_no" json:"id_card_no" form:"id_card_no"`
9
+	Birthday    int64  `gorm:"column:birthday" json:"birthday" form:"birthday"`
10
+	Phone       string `gorm:"column:phone" json:"phone" form:"phone"`
11
+	Age         int64  `gorm:"column:age" json:"age"`
12
+	CreatedTime int64  `gorm:"column:created_time" json:"created_time" form:"created_time"`
13
+	UpdatedTime int64  `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
14
+}
15
+
16
+func (PatientListForFace) TableName() string {
17
+	return "xt_patients"
18
+}
19
+
3 20
 type Patients struct {
4 21
 	ID                           int64                `gorm:"column:id" json:"id" form:"id"`
5 22
 	UserOrgId                    int64                `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`

+ 9 - 0
service/patient_service.go Datei anzeigen

@@ -80,6 +80,15 @@ func GetAllPatientList(orgID int64) (patients []*models.Patients, total int64, e
80 80
 	return
81 81
 }
82 82
 
83
+func GetPatientListByUpdateTime(orgID int64, syncTime int64, force int64) (patients []*models.PatientListForFace, total int64, err error) {
84
+	db := readDb.Model(&models.PatientListForFace{}).Where("user_org_id=? and status=1", orgID)
85
+	if force == 0 {
86
+		db = db.Where("updated_time >= ?", syncTime)
87
+	}
88
+	err = db.Count(&total).Find(&patients).Error
89
+	return
90
+}
91
+
83 92
 func GetPatientCount(orgID int64) (total int64) {
84 93
 	readDb.Model(&models.Patients{}).Where("user_org_id=? and status=1", orgID).Count(&total)
85 94
 	return