|
@@ -4,15 +4,15 @@ import (
|
4
|
4
|
"XT_New/enums"
|
5
|
5
|
"XT_New/models"
|
6
|
6
|
"XT_New/service"
|
7
|
|
- "github.com/astaxie/beego"
|
8
|
|
- "net/http"
|
9
|
|
- "net/url"
|
10
|
|
- "strconv"
|
11
|
7
|
_ "XT_New/utils"
|
12
|
8
|
_ "encoding/json"
|
13
|
9
|
"fmt"
|
|
10
|
+ "github.com/astaxie/beego"
|
14
|
11
|
_ "github.com/astaxie/beego"
|
15
|
12
|
"github.com/jinzhu/gorm"
|
|
13
|
+ "net/http"
|
|
14
|
+ "net/url"
|
|
15
|
+ "strconv"
|
16
|
16
|
_ "strings"
|
17
|
17
|
|
18
|
18
|
// "fmt"
|
|
@@ -67,106 +67,106 @@ func (c *CheckWeightApiController) SaveBloodPressure() {
|
67
|
67
|
if dialysistype == 1 {
|
68
|
68
|
// 保存透前相关数据
|
69
|
69
|
// 获取透析处方
|
70
|
|
- dialysisPrescribe, getDialysisPrescribeErr := service.MobileGetDialysisPrescribe(adminUserInfo.Org.Id, id, theAssessmentDateTime)
|
71
|
|
- if getDialysisPrescribeErr != nil {
|
72
|
|
- c.ErrorLog("获取透析处方失败:%v", getDialysisPrescribeErr)
|
73
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
74
|
|
- return
|
75
|
|
- }
|
76
|
|
-
|
77
|
|
- // 获取透析模版
|
78
|
|
- dialysisSolution, getDialysisSolutionErr := service.MobileGetDialysisSolution(adminUserInfo.Org.Id, id)
|
79
|
|
- if getDialysisSolutionErr != nil {
|
80
|
|
- c.ErrorLog("获取透析方案失败:%v", getDialysisSolutionErr)
|
81
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
82
|
|
- return
|
83
|
|
- }
|
|
70
|
+ //dialysisPrescribe, getDialysisPrescribeErr := service.MobileGetDialysisPrescribe(adminUserInfo.Org.Id, id, theAssessmentDateTime)
|
|
71
|
+ //if getDialysisPrescribeErr != nil {
|
|
72
|
+ // c.ErrorLog("获取透析处方失败:%v", getDialysisPrescribeErr)
|
|
73
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
74
|
+ // return
|
|
75
|
+ //}
|
|
76
|
+ //
|
|
77
|
+ //// 获取透析模版
|
|
78
|
+ //dialysisSolution, getDialysisSolutionErr := service.MobileGetDialysisSolution(adminUserInfo.Org.Id, id)
|
|
79
|
+ //if getDialysisSolutionErr != nil {
|
|
80
|
+ // c.ErrorLog("获取透析方案失败:%v", getDialysisSolutionErr)
|
|
81
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
82
|
+ // return
|
|
83
|
+ //}
|
84
|
84
|
|
85
|
85
|
// 插入透析处方
|
86
|
|
- if dialysisPrescribe == nil && dialysisSolution != nil {
|
87
|
|
- var newprescribe models.DialysisPrescription
|
88
|
|
- newprescribe.UserOrgId = dialysisSolution.UserOrgId
|
89
|
|
- newprescribe.PatientId = dialysisSolution.PatientId
|
90
|
|
- newprescribe.Anticoagulant = dialysisSolution.Anticoagulant
|
91
|
|
- newprescribe.AnticoagulantShouji = dialysisSolution.AnticoagulantShouji
|
92
|
|
- newprescribe.AnticoagulantWeichi = dialysisSolution.AnticoagulantWeichi
|
93
|
|
- newprescribe.AnticoagulantZongliang = dialysisSolution.AnticoagulantZongliang
|
94
|
|
- newprescribe.AnticoagulantGaimingcheng = dialysisSolution.AnticoagulantGaimingcheng
|
95
|
|
- newprescribe.AnticoagulantGaijiliang = dialysisSolution.AnticoagulantGaijiliang
|
96
|
|
- newprescribe.ModeId = dialysisSolution.ModeId
|
97
|
|
- newprescribe.DialysisDuration = dialysisSolution.DialysisDuration
|
98
|
|
- newprescribe.ReplacementWay = dialysisSolution.ReplacementWay
|
99
|
|
- newprescribe.HemodialysisMachine = dialysisSolution.HemodialysisMachine
|
100
|
|
- newprescribe.BloodFilter = dialysisSolution.BloodFilter
|
101
|
|
- newprescribe.PerfusionApparatus = dialysisSolution.PerfusionApparatus
|
102
|
|
- newprescribe.BloodFlowVolume = dialysisSolution.BloodFlowVolume
|
103
|
|
- newprescribe.DisplaceLiqui = dialysisSolution.DisplaceLiqui
|
104
|
|
- newprescribe.Glucose = dialysisSolution.Glucose
|
105
|
|
- newprescribe.DialysateFlow = dialysisSolution.DialysateFlow
|
106
|
|
- newprescribe.Kalium = dialysisSolution.Kalium
|
107
|
|
- newprescribe.Sodium = dialysisSolution.Sodium
|
108
|
|
- newprescribe.Calcium = dialysisSolution.Calcium
|
109
|
|
- newprescribe.Bicarbonate = dialysisSolution.Bicarbonate
|
110
|
|
- newprescribe.DialysateTemperature = dialysisSolution.DialysateTemperature
|
111
|
|
- newprescribe.Conductivity = dialysisSolution.Conductivity
|
112
|
|
- newprescribe.BodyFluid = dialysisSolution.BodyFluid
|
113
|
|
- newprescribe.SpecialMedicine = dialysisSolution.SpecialMedicine
|
114
|
|
- newprescribe.SpecialMedicineOther = dialysisSolution.SpecialMedicineOther
|
115
|
|
- newprescribe.DisplaceLiquiPart = dialysisSolution.DisplaceLiquiPart
|
116
|
|
- newprescribe.DisplaceLiquiValue = dialysisSolution.DisplaceLiquiValue
|
117
|
|
- newprescribe.BloodAccess = dialysisSolution.BloodAccess
|
118
|
|
- newprescribe.Ultrafiltration = dialysisSolution.Ultrafiltration
|
119
|
|
- newprescribe.DialysisDurationHour = dialysisSolution.DialysisDurationHour
|
120
|
|
- newprescribe.DialysisDurationMinute = dialysisSolution.DialysisDurationMinute
|
121
|
|
- newprescribe.TargetUltrafiltration = dialysisSolution.TargetUltrafiltration
|
122
|
|
- newprescribe.DialysateFormulation = dialysisSolution.DialysateFormulation
|
123
|
|
- newprescribe.Dialyzer = dialysisSolution.Dialyzer
|
124
|
|
- newprescribe.ReplacementTotal = dialysisSolution.ReplacementTotal
|
125
|
|
- newprescribe.DialyzerPerfusionApparatus = dialysisSolution.DialyzerPerfusionApparatus
|
126
|
|
- newprescribe.BodyFluidOther = dialysisSolution.BodyFluidOther
|
127
|
|
- newprescribe.TargetKtv = dialysisSolution.TargetKtv
|
128
|
|
-
|
129
|
|
- newprescribe.CreatedTime = time.Now().Unix()
|
130
|
|
- newprescribe.UpdatedTime = time.Now().Unix()
|
131
|
|
- newprescribe.RecordDate = theAssessmentDateTime
|
132
|
|
- // newprescribe.DewaterAmount = dewater_amount
|
133
|
|
- // newprescribe.TargetUltrafiltration = dewater_amount
|
134
|
|
- newprescribe.Status = 1
|
135
|
|
-
|
136
|
|
- err := service.AddSigleRecord(&newprescribe)
|
137
|
|
- if err != nil {
|
138
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCommitFail)
|
139
|
|
- }
|
140
|
|
- }
|
141
|
|
-
|
142
|
|
- if dialysisPrescribe == nil && dialysisSolution == nil {
|
143
|
|
- var newprescribe models.DialysisPrescription
|
144
|
|
- newprescribe.UserOrgId = adminUserInfo.Org.Id
|
145
|
|
- newprescribe.PatientId = id
|
146
|
|
- newprescribe.CreatedTime = time.Now().Unix()
|
147
|
|
- newprescribe.UpdatedTime = time.Now().Unix()
|
148
|
|
- newprescribe.RecordDate = theAssessmentDateTime
|
149
|
|
- // newprescribe.DewaterAmount = dewater_amount
|
150
|
|
- // newprescribe.TargetUltrafiltration = dewater_amount
|
151
|
|
- newprescribe.Status = 1
|
152
|
|
-
|
153
|
|
- err := service.AddSigleRecord(&newprescribe)
|
154
|
|
- if err != nil {
|
155
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCommitFail)
|
156
|
|
- }
|
157
|
|
- }
|
158
|
|
-
|
159
|
|
- if dialysisPrescribe != nil {
|
160
|
|
- dialysisPrescribe.UpdatedTime = time.Now().Unix()
|
161
|
|
- dialysisPrescribe.RecordDate = theAssessmentDateTime
|
162
|
|
- // dialysisPrescribe.DewaterAmount = dewater_amount
|
163
|
|
- // dialysisPrescribe.TargetUltrafiltration = dewater_amount
|
164
|
|
- dialysisPrescribe.Status = 1
|
165
|
|
- updateErr := service.UpDateDialysisPrescription(dialysisPrescribe)
|
166
|
|
- if updateErr != nil {
|
167
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCommitFail)
|
168
|
|
- }
|
169
|
|
- }
|
|
86
|
+ //if dialysisPrescribe == nil && dialysisSolution != nil {
|
|
87
|
+ // var newprescribe models.DialysisPrescription
|
|
88
|
+ // newprescribe.UserOrgId = dialysisSolution.UserOrgId
|
|
89
|
+ // newprescribe.PatientId = dialysisSolution.PatientId
|
|
90
|
+ // newprescribe.Anticoagulant = dialysisSolution.Anticoagulant
|
|
91
|
+ // newprescribe.AnticoagulantShouji = dialysisSolution.AnticoagulantShouji
|
|
92
|
+ // newprescribe.AnticoagulantWeichi = dialysisSolution.AnticoagulantWeichi
|
|
93
|
+ // newprescribe.AnticoagulantZongliang = dialysisSolution.AnticoagulantZongliang
|
|
94
|
+ // newprescribe.AnticoagulantGaimingcheng = dialysisSolution.AnticoagulantGaimingcheng
|
|
95
|
+ // newprescribe.AnticoagulantGaijiliang = dialysisSolution.AnticoagulantGaijiliang
|
|
96
|
+ // newprescribe.ModeId = dialysisSolution.ModeId
|
|
97
|
+ // newprescribe.DialysisDuration = dialysisSolution.DialysisDuration
|
|
98
|
+ // newprescribe.ReplacementWay = dialysisSolution.ReplacementWay
|
|
99
|
+ // newprescribe.HemodialysisMachine = dialysisSolution.HemodialysisMachine
|
|
100
|
+ // newprescribe.BloodFilter = dialysisSolution.BloodFilter
|
|
101
|
+ // newprescribe.PerfusionApparatus = dialysisSolution.PerfusionApparatus
|
|
102
|
+ // newprescribe.BloodFlowVolume = dialysisSolution.BloodFlowVolume
|
|
103
|
+ // newprescribe.DisplaceLiqui = dialysisSolution.DisplaceLiqui
|
|
104
|
+ // newprescribe.Glucose = dialysisSolution.Glucose
|
|
105
|
+ // newprescribe.DialysateFlow = dialysisSolution.DialysateFlow
|
|
106
|
+ // newprescribe.Kalium = dialysisSolution.Kalium
|
|
107
|
+ // newprescribe.Sodium = dialysisSolution.Sodium
|
|
108
|
+ // newprescribe.Calcium = dialysisSolution.Calcium
|
|
109
|
+ // newprescribe.Bicarbonate = dialysisSolution.Bicarbonate
|
|
110
|
+ // newprescribe.DialysateTemperature = dialysisSolution.DialysateTemperature
|
|
111
|
+ // newprescribe.Conductivity = dialysisSolution.Conductivity
|
|
112
|
+ // newprescribe.BodyFluid = dialysisSolution.BodyFluid
|
|
113
|
+ // newprescribe.SpecialMedicine = dialysisSolution.SpecialMedicine
|
|
114
|
+ // newprescribe.SpecialMedicineOther = dialysisSolution.SpecialMedicineOther
|
|
115
|
+ // newprescribe.DisplaceLiquiPart = dialysisSolution.DisplaceLiquiPart
|
|
116
|
+ // newprescribe.DisplaceLiquiValue = dialysisSolution.DisplaceLiquiValue
|
|
117
|
+ // newprescribe.BloodAccess = dialysisSolution.BloodAccess
|
|
118
|
+ // newprescribe.Ultrafiltration = dialysisSolution.Ultrafiltration
|
|
119
|
+ // newprescribe.DialysisDurationHour = dialysisSolution.DialysisDurationHour
|
|
120
|
+ // newprescribe.DialysisDurationMinute = dialysisSolution.DialysisDurationMinute
|
|
121
|
+ // newprescribe.TargetUltrafiltration = dialysisSolution.TargetUltrafiltration
|
|
122
|
+ // newprescribe.DialysateFormulation = dialysisSolution.DialysateFormulation
|
|
123
|
+ // newprescribe.Dialyzer = dialysisSolution.Dialyzer
|
|
124
|
+ // newprescribe.ReplacementTotal = dialysisSolution.ReplacementTotal
|
|
125
|
+ // newprescribe.DialyzerPerfusionApparatus = dialysisSolution.DialyzerPerfusionApparatus
|
|
126
|
+ // newprescribe.BodyFluidOther = dialysisSolution.BodyFluidOther
|
|
127
|
+ // newprescribe.TargetKtv = dialysisSolution.TargetKtv
|
|
128
|
+ //
|
|
129
|
+ // newprescribe.CreatedTime = time.Now().Unix()
|
|
130
|
+ // newprescribe.UpdatedTime = time.Now().Unix()
|
|
131
|
+ // newprescribe.RecordDate = theAssessmentDateTime
|
|
132
|
+ // // newprescribe.DewaterAmount = dewater_amount
|
|
133
|
+ // // newprescribe.TargetUltrafiltration = dewater_amount
|
|
134
|
+ // newprescribe.Status = 1
|
|
135
|
+ //
|
|
136
|
+ // err := service.AddSigleRecord(&newprescribe)
|
|
137
|
+ // if err != nil {
|
|
138
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCommitFail)
|
|
139
|
+ // }
|
|
140
|
+ //}
|
|
141
|
+
|
|
142
|
+ //if dialysisPrescribe == nil && dialysisSolution == nil {
|
|
143
|
+ // var newprescribe models.DialysisPrescription
|
|
144
|
+ // newprescribe.UserOrgId = adminUserInfo.Org.Id
|
|
145
|
+ // newprescribe.PatientId = id
|
|
146
|
+ // newprescribe.CreatedTime = time.Now().Unix()
|
|
147
|
+ // newprescribe.UpdatedTime = time.Now().Unix()
|
|
148
|
+ // newprescribe.RecordDate = theAssessmentDateTime
|
|
149
|
+ // // newprescribe.DewaterAmount = dewater_amount
|
|
150
|
+ // // newprescribe.TargetUltrafiltration = dewater_amount
|
|
151
|
+ // newprescribe.Status = 1
|
|
152
|
+ //
|
|
153
|
+ // err := service.AddSigleRecord(&newprescribe)
|
|
154
|
+ // if err != nil {
|
|
155
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCommitFail)
|
|
156
|
+ // }
|
|
157
|
+ //}
|
|
158
|
+
|
|
159
|
+ //if dialysisPrescribe != nil {
|
|
160
|
+ // dialysisPrescribe.UpdatedTime = time.Now().Unix()
|
|
161
|
+ // dialysisPrescribe.RecordDate = theAssessmentDateTime
|
|
162
|
+ // // dialysisPrescribe.DewaterAmount = dewater_amount
|
|
163
|
+ // // dialysisPrescribe.TargetUltrafiltration = dewater_amount
|
|
164
|
+ // dialysisPrescribe.Status = 1
|
|
165
|
+ // updateErr := service.UpDateDialysisPrescription(dialysisPrescribe)
|
|
166
|
+ // if updateErr != nil {
|
|
167
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCommitFail)
|
|
168
|
+ // }
|
|
169
|
+ //}
|
170
|
170
|
|
171
|
171
|
theEvaluation, getPEErr := service.MobileGetPredialysisEvaluation(adminUserInfo.Org.Id, id, theAssessmentDateTime)
|
172
|
172
|
if getPEErr != nil {
|
|
@@ -692,7 +692,6 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
|
692
|
692
|
}
|
693
|
693
|
}
|
694
|
694
|
}
|
695
|
|
-
|
696
|
695
|
func (c *CheckWeightApiController) GetPatientList() {
|
697
|
696
|
syncTime, _ := c.GetInt64("synctime", 0)
|
698
|
697
|
force, _ := c.GetInt64("force", 0)
|
|
@@ -710,7 +709,6 @@ func (c *CheckWeightApiController) GetPatientList() {
|
710
|
709
|
"servicetime": serviceTime,
|
711
|
710
|
})
|
712
|
711
|
}
|
713
|
|
-
|
714
|
712
|
func (c *CheckWeightApiController) GetPatientListById() {
|
715
|
713
|
patientId, _ := c.GetInt64("patient_id", 0)
|
716
|
714
|
if patientId <= 0 {
|
|
@@ -729,7 +727,6 @@ func (c *CheckWeightApiController) GetPatientListById() {
|
729
|
727
|
"patientinfo": patient,
|
730
|
728
|
})
|
731
|
729
|
}
|
732
|
|
-
|
733
|
730
|
func (c *CheckWeightApiController) GetPatientInfoDialysis() {
|
734
|
731
|
id, _ := c.GetInt64("patient", 0)
|
735
|
732
|
if id <= 0 {
|
|
@@ -797,7 +794,7 @@ func (c *CheckWeightApiController) GetPatientInfoDialysis() {
|
797
|
794
|
|
798
|
795
|
// 排队叫号的签到
|
799
|
796
|
ssoDomain := beego.AppConfig.String("call_domain")
|
800
|
|
- api := ssoDomain + "/index/patientsign/"+strconv.FormatInt(adminUserInfo.Org.Id, 10)+"/"+strconv.FormatInt(id, 10)
|
|
797
|
+ api := ssoDomain + "/index/patientsign/" + strconv.FormatInt(adminUserInfo.Org.Id, 10) + "/" + strconv.FormatInt(id, 10)
|
801
|
798
|
values := make(url.Values)
|
802
|
799
|
|
803
|
800
|
http.PostForm(api, values)
|
|
@@ -964,8 +961,6 @@ func (c *CheckWeightApiController) GetPatientInfoDialysis() {
|
964
|
961
|
}
|
965
|
962
|
}
|
966
|
963
|
|
967
|
|
-
|
968
|
|
-
|
969
|
964
|
c.ServeSuccessJSON(map[string]interface{}{
|
970
|
965
|
"dialysistype": dialysistype,
|
971
|
966
|
"patient": dialysisinfo,
|
|
@@ -975,7 +970,6 @@ func (c *CheckWeightApiController) GetPatientInfoDialysis() {
|
975
|
970
|
})
|
976
|
971
|
return
|
977
|
972
|
}
|
978
|
|
-
|
979
|
973
|
func (c *CheckWeightApiController) GetPatientInfoBeforeDialysis() {
|
980
|
974
|
id, _ := c.GetInt64("patient", 0)
|
981
|
975
|
if id <= 0 {
|