Selaa lähdekoodia

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

csx 4 vuotta sitten
vanhempi
commit
fe7e1ac1c6

+ 12 - 9
controllers/gdyb_controller.go Näytä tiedosto

@@ -35,7 +35,7 @@ func (c *GdybController) PostTwo() {
35 35
 	psnNo := c.GetString("psn_no")
36 36
 	insutype := c.GetString("insutype")
37 37
 	certNo := c.GetString("cert_no")
38
-	result := service.Gdyb2201(psnNo,insutype,certNo)
38
+	result := service.Gdyb2201(psnNo, insutype, certNo)
39 39
 	c.ServeSuccessJSON(map[string]interface{}{
40 40
 		"pre": result,
41 41
 	})
@@ -44,7 +44,7 @@ func (c *GdybController) PostTwo() {
44 44
 func (c *GdybController) PostThree() {
45 45
 	psnNo := c.GetString("psn_no")
46 46
 	mdtrtId := c.GetString("mdtrt_id")
47
-	result := service.Gdyb2202(psnNo,mdtrtId)
47
+	result := service.Gdyb2202(psnNo, mdtrtId)
48 48
 	c.ServeSuccessJSON(map[string]interface{}{
49 49
 		"pre": result,
50 50
 	})
@@ -53,7 +53,7 @@ func (c *GdybController) PostThree() {
53 53
 func (c *GdybController) PostFour() {
54 54
 	psnNo := c.GetString("psn_no")
55 55
 	mdtrtId := c.GetString("mdtrt_id")
56
-	result := service.Gdyb2203(psnNo,mdtrtId)
56
+	result := service.Gdyb2203(psnNo, mdtrtId)
57 57
 	c.ServeSuccessJSON(map[string]interface{}{
58 58
 		"pre": result,
59 59
 	})
@@ -62,7 +62,10 @@ func (c *GdybController) PostFour() {
62 62
 func (c *GdybController) PostFive() {
63 63
 	psnNo := c.GetString("psn_no")
64 64
 	mdtrtId := c.GetString("mdtrt_id")
65
-	result := service.Gdyb2204(psnNo,mdtrtId)
65
+	prescriptions, _ := service.GetHisPrescription(4, 1, 1605715200)
66
+
67
+	result := service.Gdyb2204(psnNo, mdtrtId, prescriptions)
68
+
66 69
 	c.ServeSuccessJSON(map[string]interface{}{
67 70
 		"pre": result,
68 71
 	})
@@ -72,7 +75,7 @@ func (c *GdybController) PostSix() {
72 75
 	psnNo := c.GetString("psn_no")
73 76
 	mdtrtId := c.GetString("mdtrt_id")
74 77
 	chrgBchno := c.GetString("chrg_bchno")
75
-	result := service.Gdyb2205(psnNo,mdtrtId,chrgBchno)
78
+	result := service.Gdyb2205(psnNo, mdtrtId, chrgBchno)
76 79
 	c.ServeSuccessJSON(map[string]interface{}{
77 80
 		"pre": result,
78 81
 	})
@@ -84,7 +87,7 @@ func (c *GdybController) PostSeven() {
84 87
 	chrgBchno := c.GetString("chrg_bchno")
85 88
 	certNo := c.GetString("cert_no")
86 89
 	insutype := c.GetString("insutype")
87
-	result := service.Gdyb2206(psnNo,mdtrtId,chrgBchno,certNo,insutype)
90
+	result := service.Gdyb2206(psnNo, mdtrtId, chrgBchno, certNo, insutype)
88 91
 	c.ServeSuccessJSON(map[string]interface{}{
89 92
 		"pre": result,
90 93
 	})
@@ -96,7 +99,7 @@ func (c *GdybController) PostEight() {
96 99
 	chrgBchno := c.GetString("chrg_bchno")
97 100
 	certNo := c.GetString("cert_no")
98 101
 	insutype := c.GetString("insutype")
99
-	result := service.Gdyb2207(psnNo,mdtrtId,chrgBchno,certNo,insutype)
102
+	result := service.Gdyb2207(psnNo, mdtrtId, chrgBchno, certNo, insutype)
100 103
 	c.ServeSuccessJSON(map[string]interface{}{
101 104
 		"pre": result,
102 105
 	})
@@ -106,8 +109,8 @@ func (c *GdybController) PostNine() {
106 109
 	psnNo := c.GetString("psn_no")
107 110
 	mdtrtId := c.GetString("mdtrt_id")
108 111
 	setlId := c.GetString("setl_id")
109
-	result := service.Gdyb2208(psnNo,mdtrtId,setlId)
112
+	result := service.Gdyb2208(psnNo, mdtrtId, setlId)
110 113
 	c.ServeSuccessJSON(map[string]interface{}{
111 114
 		"pre": result,
112 115
 	})
113
-}
116
+}

+ 2 - 2
controllers/mobile_api_controllers/check_weight_api_controller.go Näytä tiedosto

@@ -336,7 +336,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
336 336
 
337 337
 	template, _ := service.GetOrgInfoTemplate(adminUserInfo.Org.Id)
338 338
 
339
-	if template.TemplateId == 22 || template.TemplateId == 17 || template.TemplateId == 21 {
339
+	if template.TemplateId == 22 || template.TemplateId == 17 || template.TemplateId == 21 || template.TemplateId == 26 {
340 340
 		dewater_amount = dewater_amount * 1000
341 341
 
342 342
 		if dewater_amount < 0 {
@@ -643,7 +643,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
643 643
 		evaluation.WeightBefore = weighing_before
644 644
 		evaluation.AssessmentTime = time.Now().Unix()
645 645
 
646
-		err := service.UpadatePredialysisEvaluation(&evaluation)
646
+		err = service.UpadatePredialysisEvaluation(&evaluation)
647 647
 		if err != nil {
648 648
 			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDBUpdate)
649 649
 			return

+ 1 - 1
controllers/mobile_api_controllers/patient_api_controller.go Näytä tiedosto

@@ -1414,7 +1414,7 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
1414 1414
 	if evaluation.DryWeight > 0 {
1415 1415
 		dewater_amount = evaluation.WeightBefore - evaluation.DryWeight - evaluation.AdditionalWeight
1416 1416
 
1417
-		if template.TemplateId == 17 || template.TemplateId == 22 || template.TemplateId == 21 {
1417
+		if template.TemplateId == 17 || template.TemplateId == 22 || template.TemplateId == 21 || template.TemplateId == 26 {
1418 1418
 			dewater_amount = dewater_amount * 1000
1419 1419
 
1420 1420
 		}

+ 2 - 0
models/his_models.go Näytä tiedosto

@@ -192,6 +192,7 @@ type HisDoctorAdviceInfo struct {
192 192
 	DrugId                int64   `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
193 193
 	Price                 float64 `gorm:"column:price" json:"price" form:"price"`
194 194
 	PrescriptionId        int64   `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
195
+	MedListCodg           string  `gorm:"column:med_list_codg" json:"med_list_codg" form:"med_list_codg"`
195 196
 }
196 197
 
197 198
 func (HisDoctorAdviceInfo) TableName() string {
@@ -413,6 +414,7 @@ type HisPrescriptionProject struct {
413 414
 	HisPatientId   int64   `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
414 415
 	RecordDate     int64   `gorm:"column:record_date" json:"record_date" form:"record_date"`
415 416
 	PrescriptionId int64   `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
417
+	Count          int64   `gorm:"column:count" json:"count" form:"count"`
416 418
 }
417 419
 
418 420
 func (HisPrescriptionProject) TableName() string {

File diff suppressed because it is too large
+ 629 - 622
service/gdyb_service.go


+ 1 - 1
service/his_service.go Näytä tiedosto

@@ -121,7 +121,7 @@ func GetHisPrescription(org_id int64, patient_id int64, record_date int64) (pres
121 121
 		Preload("HisDoctorAdviceInfo", "status = 1 AND user_org_id = ?", org_id).
122 122
 		Preload("HisPrescriptionProject", "status = 1 AND user_org_id = ?", org_id).
123 123
 		Where("user_org_id = ? AND status = 1 AND record_date = ? AND patient_id = ?", org_id, record_date, patient_id).
124
-		First(&prescription).Error
124
+		Find(&prescription).Error
125 125
 	return
126 126
 }
127 127