|
@@ -5184,6 +5184,7 @@ type Result5301For10265 struct {
|
5184
|
5184
|
}
|
5185
|
5185
|
|
5186
|
5186
|
//获取个人信息----挂号-----上传就诊信息
|
|
5187
|
+
|
5187
|
5188
|
func (c *HisApiController) GetRegisterInfo() {
|
5188
|
5189
|
id, _ := c.GetInt64("id")
|
5189
|
5190
|
record_time := c.GetString("record_time")
|
|
@@ -5650,8 +5651,6 @@ func (c *HisApiController) GetRegisterInfo() {
|
5650
|
5651
|
}
|
5651
|
5652
|
infocode, _ = strconv.ParseInt(resThree10265.Infcode, 10, 64)
|
5652
|
5653
|
} else {
|
5653
|
|
- //Check3101(c, patient.ID, his.ID, admin_user_id)
|
5654
|
|
-
|
5655
|
5654
|
psn_info, _ := service.GetPsnByPatientId(id)
|
5656
|
5655
|
result, requestLog := service.Gdyb2201A(res.Output.Baseinfo.PsnNo, insutype, IdCardNo, miConfig.OrgName, roles.UserName, ipt_otp_no, department.Name, miConfig.Code, department.Number, doctor_info.DoctorNumber, insuplc_admdvs_temp, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, doctor_info.UserName, record_time, psn_info.VerifyNumber)
|
5657
|
5656
|
saveLog(result, requestLog, "2201A", "挂号")
|
|
@@ -5717,94 +5716,9 @@ func (c *HisApiController) GetRegisterInfo() {
|
5717
|
5716
|
service.UpdateHisPatientStatus(&his)
|
5718
|
5717
|
service.UpdateHisPrescriptionHisID(his.ID, patient.ID, recordDateTime, adminInfo.CurrentOrgId)
|
5719
|
5718
|
|
5720
|
|
- var prescriptions []*models.HisPrescription
|
5721
|
|
- res := Check3101(c, patient.ID, his.ID, admin_user_id, "1", record_time, prescriptions)
|
5722
|
|
-
|
5723
|
|
- if res.Infcode == "0" {
|
5724
|
|
- if len(res.Output.Result) > 0 {
|
5725
|
|
- var res2 ResultSix
|
5726
|
|
- var resSix10265 ResultSix10265
|
5727
|
|
- var api3 string
|
5728
|
|
- if miConfig.MdtrtareaAdmvs == "320921" {
|
5729
|
|
- api3 = "http://192.168.2.110:9532/" + "jsyb/2202?psn_no=" + his.PsnNo +
|
5730
|
|
- "&mdtrt_id=" + his.Number + "&ipt_otp_no=" + his.IptOtpNo + "&doctor=" + roles.UserName + "&org_name=" + miConfig.OrgName + "&fixmedins_code=" + miConfig.Code +
|
5731
|
|
- "&insuplc_admdvs=" + his.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&url=" + miConfig.Url + "&ak=" + miConfig.AccessKey + "&cainfo=" + miConfig.Cainfo
|
5732
|
|
-
|
5733
|
|
- //req, _ = http.NewRequest("POST", "http://192.168.2.110:9532/"+"jsyb/2204", bytes.NewReader(bytesData))
|
5734
|
|
-
|
5735
|
|
- } else {
|
5736
|
|
- //req, _ = http.NewRequest("POST", "http://192.168.5.251:9532/"+"jsyb/2204", bytes.NewReader(bytesData))
|
5737
|
|
- api3 = "http://192.168.5.251:9532/" + "jsyb/2202?psn_no=" + his.PsnNo +
|
5738
|
|
- "&mdtrt_id=" + his.Number + "&ipt_otp_no=" + his.IptOtpNo + "&doctor=" + roles.UserName + "&org_name=" + miConfig.OrgName + "&fixmedins_code=" + miConfig.Code +
|
5739
|
|
- "&insuplc_admdvs=" + his.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&url=" + miConfig.Url + "&ak=" + miConfig.AccessKey + "&cainfo=" + miConfig.Cainfo
|
5740
|
|
- }
|
5741
|
|
-
|
5742
|
|
- resp3, requestErr3 := http.Get(api3)
|
5743
|
|
- if requestErr3 != nil {
|
5744
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
5745
|
|
- return
|
5746
|
|
- }
|
5747
|
|
-
|
5748
|
|
- body3, ioErr3 := ioutil.ReadAll(resp3.Body)
|
5749
|
|
- if ioErr3 != nil {
|
5750
|
|
- utils.ErrorLog("接口返回数据读取失败: %v", ioErr3)
|
5751
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
5752
|
|
- return
|
5753
|
|
- }
|
5754
|
|
- var respJSON3 map[string]interface{}
|
5755
|
|
- if err := json.Unmarshal([]byte(string(body3)), &respJSON3); err != nil {
|
5756
|
|
- utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
5757
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
5758
|
|
- return
|
5759
|
|
- }
|
5760
|
|
-
|
5761
|
|
- respJSON3 = respJSON3["data"].(map[string]interface{})["pre"].(map[string]interface{})
|
5762
|
|
- userJSONBytes3, _ := json.Marshal(respJSON3)
|
5763
|
|
- if err := json.Unmarshal(userJSONBytes3, &resSix10265); err != nil {
|
5764
|
|
- utils.ErrorLog("解析失败:%v", err)
|
5765
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
5766
|
|
- return
|
5767
|
|
- }
|
5768
|
|
-
|
5769
|
|
- res2.InfRefmsgid = resSix10265.InfRefmsgid
|
5770
|
|
- res2.Output = resSix10265.Output
|
5771
|
|
- res2.ErrMsg = resSix10265.ErrMsg
|
5772
|
|
- res2.Cainfo = resSix10265.Cainfo
|
5773
|
|
- res2.WarnMsg = resSix10265.WarnMsg
|
5774
|
|
- infocode, _ := strconv.ParseInt(resSix10265.Infcode, 10, 64)
|
5775
|
|
- res2.Infcode = infocode
|
5776
|
|
-
|
5777
|
|
- if res2.Infcode == 0 {
|
5778
|
|
- var msg []string
|
5779
|
|
- msg = append(msg, "挂号失败")
|
5780
|
|
- for _, item := range res.Output.Result {
|
5781
|
|
- msg = append(msg, item.VolaCont)
|
5782
|
|
- }
|
5783
|
|
- c.ServeSuccessJSON(map[string]interface{}{
|
5784
|
|
- "failed_code": -10,
|
5785
|
|
- "msg": msg,
|
5786
|
|
- })
|
5787
|
|
-
|
5788
|
|
- } else {
|
5789
|
|
- c.ServeSuccessJSON(map[string]interface{}{
|
5790
|
|
- "failed_code": -10,
|
5791
|
|
- "msg": res2.ErrMsg,
|
5792
|
|
- })
|
5793
|
|
-
|
5794
|
|
- }
|
5795
|
|
-
|
5796
|
|
- } else {
|
5797
|
|
- c.ServeSuccessJSON(map[string]interface{}{
|
5798
|
|
- "his_info": his,
|
5799
|
|
- })
|
5800
|
|
- }
|
5801
|
|
- } else {
|
5802
|
|
- c.ServeSuccessJSON(map[string]interface{}{
|
5803
|
|
- "failed_code": -10,
|
5804
|
|
- "msg": res.ErrMsg,
|
5805
|
|
- })
|
5806
|
|
-
|
5807
|
|
- }
|
|
5719
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
5720
|
+ "his_info": his,
|
|
5721
|
+ })
|
5808
|
5722
|
|
5809
|
5723
|
} else {
|
5810
|
5724
|
adminUser := c.GetAdminUserInfo()
|