|
@@ -106,7 +106,93 @@ func HisManagerApiRegistRouters() {
|
106
|
106
|
|
107
|
107
|
beego.Router("/api/getfapiaonumber", &HisApiController{}, "get:GetFaPiaoNumber")
|
108
|
108
|
|
|
109
|
+ //beego.Router("/api/associationprescription", &HisApiController{}, "get:AssociationHisPrescription")
|
|
110
|
+ //beego.Router("/api/checkhispatient", &HisApiController{}, "get:CheckHisPatient")
|
|
111
|
+
|
109
|
112
|
}
|
|
113
|
+
|
|
114
|
+//func (c *HisApiController) CheckHisPatient() {
|
|
115
|
+// record_date := c.GetString("record_date")
|
|
116
|
+// patient_id, _ := c.GetInt64("patient_id")
|
|
117
|
+//
|
|
118
|
+// timeLayout := "2006-01-02"
|
|
119
|
+// loc, _ := time.LoadLocation("Local")
|
|
120
|
+// theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
|
|
121
|
+// if err != nil {
|
|
122
|
+// c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
123
|
+// return
|
|
124
|
+// }
|
|
125
|
+// recordDateTime := theTime.Unix()
|
|
126
|
+// adminInfo := c.GetAdminUserInfo()
|
|
127
|
+// patients, _ := service.GetHisPatientInfoTwo(adminInfo.CurrentOrgId, patient_id, recordDateTime)
|
|
128
|
+// if len(patients) > 1 {
|
|
129
|
+// ps, _ := service.GetHisPrescriptionByHisPatientID(recordDateTime, adminInfo.CurrentOrgId, patient_id)
|
|
130
|
+// if len(ps) > 0 {
|
|
131
|
+// c.ServeSuccessJSON(map[string]interface{}{
|
|
132
|
+// "status": 1,
|
|
133
|
+// "msg": "关联",
|
|
134
|
+// "ps": ps,
|
|
135
|
+// })
|
|
136
|
+// } else {
|
|
137
|
+// c.ServeSuccessJSON(map[string]interface{}{
|
|
138
|
+// "status": 0,
|
|
139
|
+// "msg": "无需关联",
|
|
140
|
+// })
|
|
141
|
+// }
|
|
142
|
+// } else {
|
|
143
|
+// c.ServeSuccessJSON(map[string]interface{}{
|
|
144
|
+// "status": 0,
|
|
145
|
+// "msg": "无需关联",
|
|
146
|
+// })
|
|
147
|
+// return
|
|
148
|
+// }
|
|
149
|
+//}
|
|
150
|
+//func (c *HisApiController) AssociationHisPrescription() {
|
|
151
|
+// record_date, _ := c.GetInt64("record_date")
|
|
152
|
+// his_patient_id, _ := c.GetInt64("his_patient_id")
|
|
153
|
+// patient_id, _ := c.GetInt64("patient_id")
|
|
154
|
+// p_ids := c.GetString("p_ids")
|
|
155
|
+// p_ids_arr := strings.Split(p_ids, ",")
|
|
156
|
+// his_patient, _ := service.GetHisPatientByIdThree(his_patient_id)
|
|
157
|
+// if his_patient_id == 0 || his_patient.ID == 0 {
|
|
158
|
+// c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
159
|
+// return
|
|
160
|
+// }
|
|
161
|
+// err := service.UpdateHisPrescriptionHisIDByPID(his_patient_id, patient_id, record_date, c.GetAdminUserInfo().CurrentOrgId, p_ids_arr)
|
|
162
|
+// if err == nil {
|
|
163
|
+// c.ServeSuccessJSON(map[string]interface{}{
|
|
164
|
+// "msg": "关联处方成功",
|
|
165
|
+// })
|
|
166
|
+// return
|
|
167
|
+// } else {
|
|
168
|
+// c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
169
|
+// return
|
|
170
|
+// }
|
|
171
|
+//}
|
|
172
|
+
|
|
173
|
+//func (c *HisApiController) AssociationHisPrescription() {
|
|
174
|
+// record_date, _ := c.GetInt64("record_date")
|
|
175
|
+// his_patient_id, _ := c.GetInt64("his_patient_id")
|
|
176
|
+// patient_id, _ := c.GetInt64("patient_id")
|
|
177
|
+// p_ids := c.GetString("p_ids")
|
|
178
|
+// p_ids_arr := strings.Split(p_ids, ",")
|
|
179
|
+// his_patient, _ := service.GetHisPatientByIdThree(his_patient_id)
|
|
180
|
+// if his_patient_id == 0 || his_patient.ID == 0 {
|
|
181
|
+// c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
182
|
+// return
|
|
183
|
+// }
|
|
184
|
+// err := service.UpdateHisPrescriptionHisIDByPID(his_patient_id, patient_id, record_date, c.GetAdminUserInfo().CurrentOrgId, p_ids_arr)
|
|
185
|
+// if err == nil {
|
|
186
|
+// c.ServeSuccessJSON(map[string]interface{}{
|
|
187
|
+// "msg": "关联处方成功",
|
|
188
|
+// })
|
|
189
|
+// return
|
|
190
|
+// } else {
|
|
191
|
+// c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
192
|
+// return
|
|
193
|
+// }
|
|
194
|
+//}
|
|
195
|
+
|
110
|
196
|
func (c *HisApiController) GetFaPiaoNumber() {
|
111
|
197
|
max_order, _ := service.GetLastHisOrderTwo(c.GetAdminUserInfo().CurrentOrgId)
|
112
|
198
|
count, _ := strconv.ParseInt(max_order.FaPiaoNumber, 10, 64)
|