陈少旭 3 days ago
parent
commit
d74df44dfa
1 changed files with 210 additions and 143 deletions
  1. 210 143
      controllers/sg/his_api_controller.go

+ 210 - 143
controllers/sg/his_api_controller.go View File

6
 	"encoding/base64"
6
 	"encoding/base64"
7
 	//"github.com/jung-kurt/gofpdf"
7
 	//"github.com/jung-kurt/gofpdf"
8
 
8
 
9
-	//"github.com/tjfoc/gmsm/sm3"
10
-	"math"
11
-
12
-	"strings"
13
-	//"crypto/x509/pkix"
14
 	"encoding/json"
9
 	"encoding/json"
15
 	"fmt"
10
 	"fmt"
16
-
17
 	"gdyb/controllers"
11
 	"gdyb/controllers"
18
 	"gdyb/enums"
12
 	"gdyb/enums"
19
 	"gdyb/models"
13
 	"gdyb/models"
27
 	"github.com/shopspring/decimal"
21
 	"github.com/shopspring/decimal"
28
 	"io"
22
 	"io"
29
 	"io/ioutil"
23
 	"io/ioutil"
30
-
24
+	//"github.com/tjfoc/gmsm/sm3"
25
+	"math"
31
 	"math/rand"
26
 	"math/rand"
32
 	"net/http"
27
 	"net/http"
33
 	"net/url"
28
 	"net/url"
35
 	"path/filepath"
30
 	"path/filepath"
36
 	"regexp"
31
 	"regexp"
37
 	"strconv"
32
 	"strconv"
38
-
33
+	"strings"
39
 	"syscall"
34
 	"syscall"
40
 	"time"
35
 	"time"
41
 	"unsafe"
36
 	"unsafe"
42
-	"github.com/go-ole/go-ole"
43
-
44
 )
37
 )
45
 
38
 
46
 type HisApiController struct {
39
 type HisApiController struct {
213
 	beego.Router("/api/changedrug/four", &HisApiController{}, "get:ChangeDrugfour")
206
 	beego.Router("/api/changedrug/four", &HisApiController{}, "get:ChangeDrugfour")
214
 	//beego.Router("/api/delete_xs_bg_two", &HisApiController{}, "get:DeleteXSandBGTwo")
207
 	//beego.Router("/api/delete_xs_bg_two", &HisApiController{}, "get:DeleteXSandBGTwo")
215
 	beego.Router("/api/3201", &HisApiController{}, "get:Get3201")
208
 	beego.Router("/api/3201", &HisApiController{}, "get:Get3201")
216
-	
217
-	
218
-	
219
 
209
 
220
 }
210
 }
221
 func (c *HisApiController) Get3201() {
211
 func (c *HisApiController) Get3201() {
2286
 
2276
 
2287
 }
2277
 }
2288
 
2278
 
2289
-
2290
-
2291
-
2292
-
2293
 //func (c *HisApiController) BatchFJ3501AND3502() {
2279
 //func (c *HisApiController) BatchFJ3501AND3502() {
2294
 //	//ids := c.GetString("ids")
2280
 //	//ids := c.GetString("ids")
2295
 //	start_time := c.GetString("start_time")
2281
 //	start_time := c.GetString("start_time")
2828
 //	}
2814
 //	}
2829
 //}
2815
 //}
2830
 
2816
 
2831
-
2832
 //func (c *HisApiController) DeleteXSandBGTwo() {
2817
 //func (c *HisApiController) DeleteXSandBGTwo() {
2833
 //	patient_id, _ := c.GetInt64("patient_id")
2818
 //	patient_id, _ := c.GetInt64("patient_id")
2834
 //	admin_user_id, _ := c.GetInt64("admin_user_id")
2819
 //	admin_user_id, _ := c.GetInt64("admin_user_id")
4413
 						item.Bchno = number
4398
 						item.Bchno = number
4414
 						item.SaleDate = time.Now().Format("2006-01-02")
4399
 						item.SaleDate = time.Now().Format("2006-01-02")
4415
 
4400
 
4416
-						 service.SaveDF(item)
4401
+						service.SaveDF(item)
4417
 						//if err5 == nil {
4402
 						//if err5 == nil {
4418
 						//	if item.IsChange == 0 { //没变更,进行变更操作
4403
 						//	if item.IsChange == 0 { //没变更,进行变更操作
4419
 						//		bg_number := strconv.FormatInt(time.Now().Unix(), 10) + "-" + strconv.FormatInt(item.ID, 10) + "-" + "3502"
4404
 						//		bg_number := strconv.FormatInt(time.Now().Unix(), 10) + "-" + strconv.FormatInt(item.ID, 10) + "-" + "3502"
4466
 					}
4451
 					}
4467
 				}
4452
 				}
4468
 
4453
 
4469
-			} else
4470
-			{ //还没结算
4454
+			} else { //还没结算
4471
 				var res3507for10188 FJ3507ResultFor10188
4455
 				var res3507for10188 FJ3507ResultFor10188
4472
 
4456
 
4473
 				if item.IsChange == 0 { //没变更,进行变更操作
4457
 				if item.IsChange == 0 { //没变更,进行变更操作
4738
 	}
4722
 	}
4739
 }
4723
 }
4740
 
4724
 
4741
-
4742
-
4743
-
4744
 func (c *HisApiController) ChangeDrugthree() {
4725
 func (c *HisApiController) ChangeDrugthree() {
4745
 
4726
 
4746
 	//ids := c.GetString("ids")
4727
 	//ids := c.GetString("ids")
5181
 	}
5162
 	}
5182
 }
5163
 }
5183
 
5164
 
5184
-
5185
-
5186
-
5187
-
5188
-
5189
-
5190
-
5191
 func (c *HisApiController) ChangeDrugTen() {
5165
 func (c *HisApiController) ChangeDrugTen() {
5192
 	start_time_str := c.GetString("start_time")
5166
 	start_time_str := c.GetString("start_time")
5193
 	end_time_str := c.GetString("end_time")
5167
 	end_time_str := c.GetString("end_time")
5729
 
5703
 
5730
 }
5704
 }
5731
 
5705
 
5732
-
5733
-
5734
-
5735
-
5736
-
5737
-
5738
-
5739
-
5740
-
5741
-
5742
-
5743
-
5744
-
5745
-
5746
-
5747
-
5748
-
5749
-
5750
-
5751
-
5752
-
5753
-
5754
-
5755
-
5756
 func ChangeStock(count int64, drug *models.DrugFlow, miConfig models.MedicalInsuranceOrgConfig, chgType string, role models.UserAdminRole, number string) (string, string) {
5706
 func ChangeStock(count int64, drug *models.DrugFlow, miConfig models.MedicalInsuranceOrgConfig, chgType string, role models.UserAdminRole, number string) (string, string) {
5757
 	var struct3502 models.Struct3502
5707
 	var struct3502 models.Struct3502
5758
 	struct3502.MedListCodg = drug.HisDoctorAdviceInfo.BaseDrugLib.MedicalInsuranceNumber
5708
 	struct3502.MedListCodg = drug.HisDoctorAdviceInfo.BaseDrugLib.MedicalInsuranceNumber
5834
 	struct3505.Bchno = "---"
5784
 	struct3505.Bchno = "---"
5835
 	struct3505.FixmedinsCode = miConfig.Code
5785
 	struct3505.FixmedinsCode = miConfig.Code
5836
 	struct3505.Code = miConfig.Code
5786
 	struct3505.Code = miConfig.Code
5837
-	struct3505.FinlTrnsPric =  drug.HisDoctorAdviceInfo.Price
5838
-
5787
+	struct3505.FinlTrnsPric = drug.HisDoctorAdviceInfo.Price
5839
 
5788
 
5840
 	roles, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
5789
 	roles, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
5841
 	struct3505.PrscDrName = roles.UserName
5790
 	struct3505.PrscDrName = roles.UserName
5864
 		struct3505.PharPracCertNo = "2015026440262015440501001198"
5813
 		struct3505.PharPracCertNo = "2015026440262015440501001198"
5865
 	}
5814
 	}
5866
 
5815
 
5867
-
5868
-
5869
 	if org_id == 9919 {
5816
 	if org_id == 9919 {
5870
 		struct3505.PharName = "周君权"
5817
 		struct3505.PharName = "周君权"
5871
 		struct3505.PharPracCertNo = "089644396094401375"
5818
 		struct3505.PharPracCertNo = "089644396094401375"
5872
 	}
5819
 	}
5873
 
5820
 
5874
-
5875
 	if org_id == 10644 {
5821
 	if org_id == 10644 {
5876
 		struct3505.PharName = "陈金娣"
5822
 		struct3505.PharName = "陈金娣"
5877
 		struct3505.PharPracCertNo = "20181441500320100066"
5823
 		struct3505.PharPracCertNo = "20181441500320100066"
5948
 	} else if strings.HasPrefix(miConfig.MdtrtareaAdmvs[0:3], "440") {
5894
 	} else if strings.HasPrefix(miConfig.MdtrtareaAdmvs[0:3], "440") {
5949
 		result1, result2 := service.Gdyb3505(struct3505, struct3505.SecretKey)
5895
 		result1, result2 := service.Gdyb3505(struct3505, struct3505.SecretKey)
5950
 		return result1, result2
5896
 		return result1, result2
5951
-	}else if strings.HasPrefix(miConfig.MdtrtareaAdmvs[0:3], "361") {
5952
-		result1, result2 := service.JXyb3505(struct3505, struct3505.SecretKey,struct3505.AccessKey,struct3505.RequestUrl)
5897
+	} else if strings.HasPrefix(miConfig.MdtrtareaAdmvs[0:3], "361") {
5898
+		result1, result2 := service.JXyb3505(struct3505, struct3505.SecretKey, struct3505.AccessKey, struct3505.RequestUrl)
5953
 		return result1, result2
5899
 		return result1, result2
5954
-	}else if miConfig.MdtrtareaAdmvs == "340699" {
5955
-		result1, result2 := service.AHyb3505(struct3505, struct3505.SecretKey,struct3505.RequestUrl)
5900
+	} else if miConfig.MdtrtareaAdmvs == "340699" {
5901
+		result1, result2 := service.AHyb3505(struct3505, struct3505.SecretKey, struct3505.RequestUrl)
5956
 		return result1, result2
5902
 		return result1, result2
5957
-	}else if miConfig.MdtrtareaAdmvs == "150499" {
5903
+	} else if miConfig.MdtrtareaAdmvs == "150499" {
5958
 
5904
 
5959
 		data := make(map[string]interface{})
5905
 		data := make(map[string]interface{})
5960
 		data["struct_3505s"] = struct3505
5906
 		data["struct_3505s"] = struct3505
5978
 		result, _ := json.Marshal(respJSON)
5924
 		result, _ := json.Marshal(respJSON)
5979
 		return string(result), ""
5925
 		return string(result), ""
5980
 
5926
 
5981
-	}  else {
5927
+	} else {
5982
 		data := make(map[string]interface{})
5928
 		data := make(map[string]interface{})
5983
 		data["struct_3505s"] = struct3505
5929
 		data["struct_3505s"] = struct3505
5984
 		client := &http.Client{}
5930
 		client := &http.Client{}
13542
 	} else if miConfig.MdtrtareaAdmvs == "340699" {
13488
 	} else if miConfig.MdtrtareaAdmvs == "340699" {
13543
 		psn_info, _ := service.GetHisPatientByPatientId(patient_id)
13489
 		psn_info, _ := service.GetHisPatientByPatientId(patient_id)
13544
 
13490
 
13545
-
13546
 		var api string
13491
 		var api string
13547
 
13492
 
13548
 		api = miConfig.SecretKey + "ahyb/5301?" + "fixmedins_code=" + miConfig.Code + "&secret_key=" + miConfig.SecretKey + "&ak=" + miConfig.AccessKey + "&org_name=" + miConfig.OrgName + "&doctor=" + role.UserName +
13493
 		api = miConfig.SecretKey + "ahyb/5301?" + "fixmedins_code=" + miConfig.Code + "&secret_key=" + miConfig.SecretKey + "&ak=" + miConfig.AccessKey + "&org_name=" + miConfig.OrgName + "&doctor=" + role.UserName +
13584
 			return
13529
 			return
13585
 		}
13530
 		}
13586
 
13531
 
13587
-
13588
-
13589
-
13590
-
13591
-
13592
 	} else if miConfig.MdtrtareaAdmvs == "360302" {
13532
 	} else if miConfig.MdtrtareaAdmvs == "360302" {
13593
 		p, _ := service.GetHisPatientById(patient_id)
13533
 		p, _ := service.GetHisPatientById(patient_id)
13594
 
13534
 
14130
 	admin_user_id, _ := c.GetInt64("admin_user_id")
14070
 	admin_user_id, _ := c.GetInt64("admin_user_id")
14131
 	certificates, _ := c.GetInt64("certificates")
14071
 	certificates, _ := c.GetInt64("certificates")
14132
 
14072
 
14133
-
14134
 	//
14073
 	//
14135
 	insuplc_admdvs_str := c.GetString("insuplc_admdvs")
14074
 	insuplc_admdvs_str := c.GetString("insuplc_admdvs")
14136
 	id_card_no := c.GetString("id_card_no")
14075
 	id_card_no := c.GetString("id_card_no")
15161
 			fmt.Println(basStr)
15100
 			fmt.Println(basStr)
15162
 			bas := strings.Split(basStr, "|")
15101
 			bas := strings.Split(basStr, "|")
15163
 			basNumber := bas[2] //卡号
15102
 			basNumber := bas[2] //卡号
15164
-			card_sn := bas[3] //
15103
+			card_sn := bas[3]   //
15165
 
15104
 
15166
 			id_card_No := bas[1] //卡号
15105
 			id_card_No := bas[1] //卡号
15167
 
15106
 
15168
-
15169
 			fmt.Println(basNumber)
15107
 			fmt.Println(basNumber)
15170
 			fmt.Println(card_sn)
15108
 			fmt.Println(card_sn)
15171
 			fmt.Println(id_card_No)
15109
 			fmt.Println(id_card_No)
15172
 
15110
 
15173
 			var patient service.Patients
15111
 			var patient service.Patients
15174
-			if len(id_card_No) == 0{
15112
+			if len(id_card_No) == 0 {
15175
 
15113
 
15176
 				patient, _ = service.GetPatientByNumber(basNumber, c.GetAdminUserInfo().CurrentOrgId)
15114
 				patient, _ = service.GetPatientByNumber(basNumber, c.GetAdminUserInfo().CurrentOrgId)
15177
 
15115
 
15178
-			}else{
15116
+			} else {
15179
 				patient, _ = service.GetPatientByNumber(id_card_No, c.GetAdminUserInfo().CurrentOrgId)
15117
 				patient, _ = service.GetPatientByNumber(id_card_No, c.GetAdminUserInfo().CurrentOrgId)
15180
 
15118
 
15181
-
15182
 			}
15119
 			}
15183
 
15120
 
15184
-			result, _ := service.Jxyb1101bycard(basNumber, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, "1", miConfig.Url, miConfig.AccessKey,patient.Name,patient.IdCardNo)
15121
+			result, _ := service.Jxyb1101bycard(basNumber, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, "1", miConfig.Url, miConfig.AccessKey, patient.Name, patient.IdCardNo)
15185
 
15122
 
15186
 			//result := service.Jxyb1101(basNumber, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, certificates)
15123
 			//result := service.Jxyb1101(basNumber, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, certificates)
15187
 			var dat map[string]interface{}
15124
 			var dat map[string]interface{}
15202
 			if res.Infcode == 0 {
15139
 			if res.Infcode == 0 {
15203
 				var pateint2 service.Patients
15140
 				var pateint2 service.Patients
15204
 				var err error
15141
 				var err error
15205
-				if len(id_card_No) == 0{
15142
+				if len(id_card_No) == 0 {
15206
 					pateint2, err = service.GetPatientByNumber(basNumber, c.GetAdminUserInfo().CurrentOrgId)
15143
 					pateint2, err = service.GetPatientByNumber(basNumber, c.GetAdminUserInfo().CurrentOrgId)
15207
 
15144
 
15208
-
15209
-
15210
-				}else{
15145
+				} else {
15211
 					pateint2, err = service.GetPatientByNumber(id_card_No, c.GetAdminUserInfo().CurrentOrgId)
15146
 					pateint2, err = service.GetPatientByNumber(id_card_No, c.GetAdminUserInfo().CurrentOrgId)
15212
 
15147
 
15213
 					//patient, _ = service.GetPatientByNumber(id_card_No, c.GetAdminUserInfo().CurrentOrgId)
15148
 					//patient, _ = service.GetPatientByNumber(id_card_No, c.GetAdminUserInfo().CurrentOrgId)
15214
 
15149
 
15215
-
15216
 				}
15150
 				}
15217
 				if err == gorm.ErrRecordNotFound {
15151
 				if err == gorm.ErrRecordNotFound {
15218
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNoPateintException)
15152
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNoPateintException)
16748
 
16682
 
16749
 			}
16683
 			}
16750
 
16684
 
16751
-		}  else if miConfig.MdtrtareaAdmvs == "340699" {
16685
+		} else if miConfig.MdtrtareaAdmvs == "340699" {
16752
 			var insuplc_admdvs string
16686
 			var insuplc_admdvs string
16753
 			if len(patient.InsuplcAdmdvs) > 0 {
16687
 			if len(patient.InsuplcAdmdvs) > 0 {
16754
 				insuplc_admdvs = patient.InsuplcAdmdvs
16688
 				insuplc_admdvs = patient.InsuplcAdmdvs
16755
 			} else {
16689
 			} else {
16756
-				if len(insuplc_admdvs_str) > 0{
16690
+				if len(insuplc_admdvs_str) > 0 {
16757
 
16691
 
16758
 					insuplc_admdvs = insuplc_admdvs_str
16692
 					insuplc_admdvs = insuplc_admdvs_str
16759
-				}else{
16693
+				} else {
16760
 					insuplc_admdvs = miConfig.InsuplcAdmdvs
16694
 					insuplc_admdvs = miConfig.InsuplcAdmdvs
16761
 				}
16695
 				}
16762
 			}
16696
 			}
16763
 			//请求内网数据
16697
 			//请求内网数据
16764
 			api := miConfig.SecretKey + "ahyb/1101?url=" + miConfig.Url + "&cert_no=" + patient.IdCardNo +
16698
 			api := miConfig.SecretKey + "ahyb/1101?url=" + miConfig.Url + "&cert_no=" + patient.IdCardNo +
16765
 				"&org_name=" + miConfig.OrgName + "&doctor=" + roles.UserName + "&fixmedins_code=" + miConfig.Code +
16699
 				"&org_name=" + miConfig.OrgName + "&doctor=" + roles.UserName + "&fixmedins_code=" + miConfig.Code +
16766
-				"&insuplc_admdvs=" + insuplc_admdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(2, 10) + "&card_sn=" + "" + "&certificates=" + strconv.FormatInt(1, 10) + "&name=" + patient.Name+"&token="+""
16700
+				"&insuplc_admdvs=" + insuplc_admdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(2, 10) + "&card_sn=" + "" + "&certificates=" + strconv.FormatInt(1, 10) + "&name=" + patient.Name + "&token=" + ""
16767
 
16701
 
16768
 			resp, requestErr := http.Get(api)
16702
 			resp, requestErr := http.Get(api)
16769
 			if requestErr != nil {
16703
 			if requestErr != nil {
16784
 			}
16718
 			}
16785
 
16719
 
16786
 			status := respJSON["data"].(map[string]interface{})["status"].(string)
16720
 			status := respJSON["data"].(map[string]interface{})["status"].(string)
16787
-			if  status == "0"{
16721
+			if status == "0" {
16788
 				err_msg := respJSON["data"].(map[string]interface{})["msg"].(string)
16722
 				err_msg := respJSON["data"].(map[string]interface{})["msg"].(string)
16789
 				c.ServeSuccessJSON(map[string]interface{}{
16723
 				c.ServeSuccessJSON(map[string]interface{}{
16790
 					"failed_code": -10,
16724
 					"failed_code": -10,
16791
-					"msg":        err_msg,
16725
+					"msg":         err_msg,
16792
 				})
16726
 				})
16793
 				return
16727
 				return
16794
 			}
16728
 			}
16795
 			respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
16729
 			respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
16796
 			var res ResultTwo
16730
 			var res ResultTwo
16797
 
16731
 
16798
-
16799
 			result, _ := json.Marshal(respJSON)
16732
 			result, _ := json.Marshal(respJSON)
16800
 			fmt.Println("log")
16733
 			fmt.Println("log")
16801
 			fmt.Println(string(result))
16734
 			fmt.Println(string(result))
16822
 					infoStr := string(Iinfos)
16755
 					infoStr := string(Iinfos)
16823
 					idetinfoStr := string(Idetinfos)
16756
 					idetinfoStr := string(Idetinfos)
16824
 					psn := &models.HisPsn{
16757
 					psn := &models.HisPsn{
16825
-						PsnNo: res.Output.Baseinfo.PsnNo,
16826
-						PatientId: patient.ID,
16827
-						Certno:    res.Output.Baseinfo.Certno,
16758
+						PsnNo:       res.Output.Baseinfo.PsnNo,
16759
+						PatientId:   patient.ID,
16760
+						Certno:      res.Output.Baseinfo.Certno,
16828
 						Gend:        res.Output.Baseinfo.Gend,
16761
 						Gend:        res.Output.Baseinfo.Gend,
16829
 						Naty:        res.Output.Baseinfo.Naty,
16762
 						Naty:        res.Output.Baseinfo.Naty,
16830
 						PsnCertType: res.Output.Baseinfo.PsnCertType,
16763
 						PsnCertType: res.Output.Baseinfo.PsnCertType,
16875
 					}
16808
 					}
16876
 
16809
 
16877
 					c.ServeSuccessJSON(map[string]interface{}{
16810
 					c.ServeSuccessJSON(map[string]interface{}{
16878
-						"patient": patient,
16811
+						"patient":  patient,
16879
 						"insutype": insutype,
16812
 						"insutype": insutype,
16880
-						"number":  res.Output.Baseinfo.Certno,
16881
-						"info":  res,
16882
-
16883
-
16813
+						"number":   res.Output.Baseinfo.Certno,
16814
+						"info":     res,
16884
 					})
16815
 					})
16885
 				}
16816
 				}
16886
 			} else {
16817
 			} else {
16888
 				return
16819
 				return
16889
 			}
16820
 			}
16890
 
16821
 
16891
-
16892
-		}else {
16822
+		} else {
16893
 			SFZStr := c.GetSFZBaseInfo()
16823
 			SFZStr := c.GetSFZBaseInfo()
16894
 			id_card_str := strings.Split(SFZStr, "^")
16824
 			id_card_str := strings.Split(SFZStr, "^")
16895
 			id_card_number := id_card_str[0]
16825
 			id_card_number := id_card_str[0]
19639
 	return ConvertToString(string(str), "gbk", "utf-8")
19569
 	return ConvertToString(string(str), "gbk", "utf-8")
19640
 }
19570
 }
19641
 
19571
 
19642
-
19643
 func (c *HisApiController) GetBasBaseInfo22222() string {
19572
 func (c *HisApiController) GetBasBaseInfo22222() string {
19644
 	DllDef := syscall.MustLoadDLL("SSCardDriver.dll")
19573
 	DllDef := syscall.MustLoadDLL("SSCardDriver.dll")
19645
 	readCard := DllDef.MustFindProc("iReadCardUnclassifiedBas")
19574
 	readCard := DllDef.MustFindProc("iReadCardUnclassifiedBas")
19653
 	readCard.Call(uintptr(1), (uintptr)(unsafe.Pointer(&str1[0])))
19582
 	readCard.Call(uintptr(1), (uintptr)(unsafe.Pointer(&str1[0])))
19654
 	//ret2, _, _ := readCard.Call(uintptr(3), (uintptr)(unsafe.Pointer(&str1[0])))
19583
 	//ret2, _, _ := readCard.Call(uintptr(3), (uintptr)(unsafe.Pointer(&str1[0])))
19655
 
19584
 
19656
-
19657
 	//file, err := os.Open("C:\\Users\\Administrator\\Desktop\\11\\Power-Card\\SSCardDriver\\api.log")
19585
 	//file, err := os.Open("C:\\Users\\Administrator\\Desktop\\11\\Power-Card\\SSCardDriver\\api.log")
19658
 	//if err != nil {
19586
 	//if err != nil {
19659
 	//	fmt.Println("Error opening file:", err)
19587
 	//	fmt.Println("Error opening file:", err)
19705
 	return ConvertToString(string(str1), "gbk", "utf-8")
19633
 	return ConvertToString(string(str1), "gbk", "utf-8")
19706
 }
19634
 }
19707
 
19635
 
19708
-
19709
 func (c *HisApiController) GetahBasBaseInfo() string {
19636
 func (c *HisApiController) GetahBasBaseInfo() string {
19710
 	DllDef := syscall.MustLoadDLL("SSCardDriver.dll")
19637
 	DllDef := syscall.MustLoadDLL("SSCardDriver.dll")
19711
 	readCard := DllDef.MustFindProc("iReadCardBas")
19638
 	readCard := DllDef.MustFindProc("iReadCardBas")
25613
 	WarnInfo    interface{} `json:"warn_info"`
25540
 	WarnInfo    interface{} `json:"warn_info"`
25614
 }
25541
 }
25615
 
25542
 
25616
-
25617
-
25618
 type Result5301For10265 struct {
25543
 type Result5301For10265 struct {
25619
 	ErrMsg      string `json:"err_msg"`
25544
 	ErrMsg      string `json:"err_msg"`
25620
 	InfRefmsgid string `json:"inf_refmsgid"`
25545
 	InfRefmsgid string `json:"inf_refmsgid"`
26044
 			verify_number = psn_info.VerifyNumber
25969
 			verify_number = psn_info.VerifyNumber
26045
 			idetinfoStr = psn_info.Idetinfo
25970
 			idetinfoStr = psn_info.Idetinfo
26046
 
25971
 
26047
-
26048
 		} else if miConfig.MdtrtareaAdmvs == "430800" {
25972
 		} else if miConfig.MdtrtareaAdmvs == "430800" {
26049
 			if id_card_type == 1 {
25973
 			if id_card_type == 1 {
26050
 				psn_info, _ := service.GetPsnByPatientId(id)
25974
 				psn_info, _ := service.GetPsnByPatientId(id)
26860
 				his.Insutype = insutype
26784
 				his.Insutype = insutype
26861
 				var api string
26785
 				var api string
26862
 				ipt_otp_no = timeFormat
26786
 				ipt_otp_no = timeFormat
26863
-				api = miConfig.SecretKey + "ahyb/2201?verify_number="+cert_no+"&cert_no="+IdCardNo+"&psn_no=" + PsnNo + "&insutype=" + insutype + "&cert_no=" + cert_no + "&ipt_otp_no=" + ipt_otp_no +
26787
+				api = miConfig.SecretKey + "ahyb/2201?verify_number=" + cert_no + "&cert_no=" + IdCardNo + "&psn_no=" + PsnNo + "&insutype=" + insutype + "&cert_no=" + cert_no + "&ipt_otp_no=" + ipt_otp_no +
26864
 					"&org_name=" + miConfig.OrgName + "&opera=" + roles.UserName + "&doctor_name=" + doctor_info.UserName + "&fixmedins_code=" + miConfig.Code +
26788
 					"&org_name=" + miConfig.OrgName + "&opera=" + roles.UserName + "&doctor_name=" + doctor_info.UserName + "&fixmedins_code=" + miConfig.Code +
26865
 					"&insuplc_admdvs=" + insuplc_admdvs_temp + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(id_card_type, 10) + "&dept_code=" + department.Number + "&dept=" + department.Name + "&doctor_id=" + doctor_info.DoctorNumber + "&url=" + miConfig.Url + "&ak=" + miConfig.AccessKey + "&verify_number=" + psn_info.VerifyNumber + "&cainfo=" + miConfig.Cainfo
26789
 					"&insuplc_admdvs=" + insuplc_admdvs_temp + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(id_card_type, 10) + "&dept_code=" + department.Number + "&dept=" + department.Name + "&doctor_id=" + doctor_info.DoctorNumber + "&url=" + miConfig.Url + "&ak=" + miConfig.AccessKey + "&verify_number=" + psn_info.VerifyNumber + "&cainfo=" + miConfig.Cainfo
26866
 
26790
 
26925
 				his.Insutype = insutype
26849
 				his.Insutype = insutype
26926
 				var api string
26850
 				var api string
26927
 				ipt_otp_no = timeFormat
26851
 				ipt_otp_no = timeFormat
26928
-				api = miConfig.SecretKey + "ahyb/2201?psn_no=" + PsnNo +"&verify_number="+cert_no+"&cert_no="+IdCardNo+ "&insutype=" + insutype + "&cert_no=" + cert_no + "&ipt_otp_no=" + ipt_otp_no +
26852
+				api = miConfig.SecretKey + "ahyb/2201?psn_no=" + PsnNo + "&verify_number=" + cert_no + "&cert_no=" + IdCardNo + "&insutype=" + insutype + "&cert_no=" + cert_no + "&ipt_otp_no=" + ipt_otp_no +
26929
 					"&org_name=" + miConfig.OrgName + "&opera=" + roles.UserName + "&doctor_name=" + doctor_info.UserName + "&fixmedins_code=" + miConfig.Code +
26853
 					"&org_name=" + miConfig.OrgName + "&opera=" + roles.UserName + "&doctor_name=" + doctor_info.UserName + "&fixmedins_code=" + miConfig.Code +
26930
 					"&insuplc_admdvs=" + insuplc_admdvs_temp + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(id_card_type, 10) + "&dept_code=" + department.Number + "&dept=" + department.Name + "&doctor_id=" + doctor_info.DoctorNumber + "&url=" + miConfig.Url + "&ak=" + miConfig.AccessKey + "&verify_number=" + psn_info.VerifyNumber + "&cainfo=" + miConfig.Cainfo
26854
 					"&insuplc_admdvs=" + insuplc_admdvs_temp + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(id_card_type, 10) + "&dept_code=" + department.Number + "&dept=" + department.Name + "&doctor_id=" + doctor_info.DoctorNumber + "&url=" + miConfig.Url + "&ak=" + miConfig.AccessKey + "&verify_number=" + psn_info.VerifyNumber + "&cainfo=" + miConfig.Cainfo
26931
 
26855
 
27307
 						insuplc_admdvs_temp = miConfig.MdtrtareaAdmvs
27231
 						insuplc_admdvs_temp = miConfig.MdtrtareaAdmvs
27308
 
27232
 
27309
 					}
27233
 					}
27234
+					var result string
27235
+					var requestLog string
27236
+					if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" {
27237
+						var hisPrescription []*models.HisPrescription
27238
+						res3101 := Checkgd3101ForOne(c, patient.ID, his, admin_user_id, "1", record_time, hisPrescription, department)
27239
+						if res3101.Infcode == 0 {
27240
+							if len(res3101.Output.Result) > 0 {
27241
+								for _, item := range res3101.Output.Result {
27242
+									if len(res3101.ErrMsg) == 0 {
27243
+										res3101.ErrMsg = item.VolaCont
27244
+									} else {
27245
+										res3101.ErrMsg = res3101.ErrMsg + "\n" + item.VolaCont
27246
+									}
27247
+								}
27248
+								c.ServeSuccessJSON(map[string]interface{}{
27249
+									"failed_code": -10,
27250
+									"msg":         res3101.ErrMsg,
27251
+								})
27252
+								return
27253
+							} else {
27254
+
27255
+								hour := time.Now().Format("15")
27256
+								min := time.Now().Format("04")
27257
+								sec := time.Now().Format("05")
27258
+
27259
+								record_time_two := record_time + " " + hour + ":" + min + ":" + sec
27260
+
27261
+								fmt.Println(record_time_two)
27262
+
27263
+								result, requestLog = service.Gdyb2201A(psn_info.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_two, psn_info.VerifyNumber, admin_user_id)
27264
+								saveLog(result, requestLog, "2201A", "挂号")
27265
+								if miConfig.Code == "H15049901371" {
27266
+
27267
+									if err := json.Unmarshal([]byte(result), &resThree10265); err != nil {
27268
+										utils.ErrorLog("解析失败:%v", err)
27269
+										c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
27270
+										return
27271
+									}
27272
+									resThree.ErrMsg = resThree10265.ErrMsg
27273
+									resThree.Output = resThree10265.Output
27274
+									resThree.InfRefmsgid = resThree10265.InfRefmsgid
27275
+								} else {
27276
+									if err := json.Unmarshal([]byte(result), &resThree); err != nil {
27277
+										utils.ErrorLog("解析失败:%v", err)
27278
+										c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
27279
+										return
27280
+									}
27281
+								}
27282
+
27283
+								if miConfig.Code == "H15049901371" {
27284
+									infocode, _ = strconv.ParseInt(resThree10265.Infcode, 10, 64)
27285
+								} else {
27286
+									infocode = resThree.Infcode
27287
+
27288
+								}
27289
+
27290
+							}
27291
+
27292
+						} else if res3101.Infcode != 0 {
27293
+							c.ServeSuccessJSON(map[string]interface{}{
27294
+								"failed_code": -10,
27295
+								"msg":         res3101.ErrMsg,
27296
+							})
27297
+							return
27298
+						}
27299
+					} else {
27300
+						result, requestLog = service.Gdyb2201A(psn_info.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_two, psn_info.VerifyNumber, admin_user_id)
27301
+						saveLog(result, requestLog, "2201A", "挂号")
27302
+					}
27310
 
27303
 
27311
-					result, requestLog := service.Gdyb2201A(psn_info.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_two, psn_info.VerifyNumber, admin_user_id)
27312
-					saveLog(result, requestLog, "2201A", "挂号")
27313
 					if miConfig.Code == "H15049901371" {
27304
 					if miConfig.Code == "H15049901371" {
27314
 
27305
 
27315
 						if err := json.Unmarshal([]byte(result), &resThree10265); err != nil {
27306
 						if err := json.Unmarshal([]byte(result), &resThree10265); err != nil {
30286
 					psn_info.VerifyNumber = his.Certno + "|" + psn_info.VerifyNumber
30277
 					psn_info.VerifyNumber = his.Certno + "|" + psn_info.VerifyNumber
30287
 				} else if his.IdCardType == 4 {
30278
 				} else if his.IdCardType == 4 {
30288
 					psn_info.VerifyNumber = strings.Replace(psn_info.VerifyNumber, "+", "%2B", -1)
30279
 					psn_info.VerifyNumber = strings.Replace(psn_info.VerifyNumber, "+", "%2B", -1)
30289
-					cert_no =psn_info.VerifyNumber
30280
+					cert_no = psn_info.VerifyNumber
30290
 					psn_info.VerifyNumber = psn_info.VerifyNumber
30281
 					psn_info.VerifyNumber = psn_info.VerifyNumber
30291
 				} else {
30282
 				} else {
30292
 					cert_no = his.Certno
30283
 					cert_no = his.Certno
30988
 	var config []*models.HisXtDiagnoseConfig
30979
 	var config []*models.HisXtDiagnoseConfig
30989
 	for _, item := range diagnosis_ids {
30980
 	for _, item := range diagnosis_ids {
30990
 		id, _ := strconv.ParseInt(item, 10, 64)
30981
 		id, _ := strconv.ParseInt(item, 10, 64)
30991
-		if  id > 0 {
30982
+		if id > 0 {
30992
 			diagnosisConfig, _ := service.FindDiagnoseById(id)
30983
 			diagnosisConfig, _ := service.FindDiagnoseById(id)
30993
 			config = append(config, &diagnosisConfig)
30984
 			config = append(config, &diagnosisConfig)
30994
 		}
30985
 		}
32033
 
32024
 
32034
 			}
32025
 			}
32035
 		} else if his.Insutype == "310" {
32026
 		} else if his.Insutype == "310" {
32036
-			if miConfig.MdtrtareaAdmvs == "341203"{
32027
+			if miConfig.MdtrtareaAdmvs == "341203" {
32037
 				if reg_type == 992102 {
32028
 				if reg_type == 992102 {
32038
 					data["diag_code"] = "ZDZ940"
32029
 					data["diag_code"] = "ZDZ940"
32039
 
32030
 
32043
 
32034
 
32044
 				}
32035
 				}
32045
 
32036
 
32037
+			} else {
32046
 
32038
 
32047
-			}else{
32048
-
32049
-
32050
-
32051
-					data["diag_code"] = sickConfig.CountryCode
32052
-
32053
-
32039
+				data["diag_code"] = sickConfig.CountryCode
32054
 
32040
 
32055
 			}
32041
 			}
32056
 
32042
 
32659
 						res.Infcode = infocode
32645
 						res.Infcode = infocode
32660
 
32646
 
32661
 					} else {
32647
 					} else {
32662
-						result, request_log := service.Gdyb2204(his.PsnNo, his.Number, prescriptions, chrg_bchno, miConfig.OrgName, roles.UserName, data["dept"].(string), data["fixmedins_code"].(string), data["dept_code"].(string), data["doctor_id"].(string), his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, data["balance_accounts_type"].(string), patientPrescription.DoctorId, sickConfig.CountryCode, admin_user_id)
32663
-						var dat map[string]interface{}
32664
-						if err := json.Unmarshal([]byte(result), &dat); err == nil {
32665
-							fmt.Println(dat)
32648
+						if miConfig.Code == "H44030903432" || miConfig.Code == "H44030501364" {
32649
+							result3101 := Checkgd3101(c, id, his_patient_id, admin_user_id, "2", record_time, prescriptions)
32650
+							if result3101.Infcode == 0 {
32651
+								if len(result3101.Output.Result) > 0 {
32652
+									var errMsgs []string
32653
+									for _, item := range result3101.Output.Result {
32654
+										errMsgs = append(errMsgs, item.VolaCont)
32655
+
32656
+									}
32657
+									c.ServeSuccessJSON(map[string]interface{}{
32658
+										"failed_code": -10,
32659
+										"msg":         errMsgs,
32660
+									})
32661
+									return
32662
+								} else {
32663
+									result, request_log := service.Gdyb2204(his.PsnNo, his.Number, prescriptions, chrg_bchno, miConfig.OrgName, roles.UserName, data["dept"].(string), data["fixmedins_code"].(string), data["dept_code"].(string), data["doctor_id"].(string), his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, data["balance_accounts_type"].(string), patientPrescription.DoctorId, sickConfig.CountryCode, admin_user_id)
32664
+									var dat map[string]interface{}
32665
+									if err := json.Unmarshal([]byte(result), &dat); err == nil {
32666
+										fmt.Println(dat)
32667
+									} else {
32668
+										fmt.Println(err)
32669
+									}
32670
+									saveLog(result, request_log, "2204", "上传费用明细")
32671
+
32672
+									userJSONBytes, _ := json.Marshal(dat)
32673
+									if err := json.Unmarshal(userJSONBytes, &res); err != nil {
32674
+										utils.ErrorLog("解析失败:%v", err)
32675
+										c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
32676
+										return
32677
+									}
32678
+
32679
+								}
32680
+							} else {
32681
+								c.ServeSuccessJSON(map[string]interface{}{
32682
+									"failed_code": -10,
32683
+									"msg":         result3101.ErrMsg,
32684
+								})
32685
+								return
32686
+							}
32687
+
32666
 						} else {
32688
 						} else {
32667
-							fmt.Println(err)
32668
-						}
32669
-						saveLog(result, request_log, "2204", "上传费用明细")
32689
+							result, request_log := service.Gdyb2204(his.PsnNo, his.Number, prescriptions, chrg_bchno, miConfig.OrgName, roles.UserName, data["dept"].(string), data["fixmedins_code"].(string), data["dept_code"].(string), data["doctor_id"].(string), his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, data["balance_accounts_type"].(string), patientPrescription.DoctorId, sickConfig.CountryCode, admin_user_id)
32690
+							var dat map[string]interface{}
32691
+							if err := json.Unmarshal([]byte(result), &dat); err == nil {
32692
+								fmt.Println(dat)
32693
+							} else {
32694
+								fmt.Println(err)
32695
+							}
32696
+							saveLog(result, request_log, "2204", "上传费用明细")
32670
 
32697
 
32671
-						userJSONBytes, _ := json.Marshal(dat)
32698
+							userJSONBytes, _ := json.Marshal(dat)
32672
 
32699
 
32673
-						if err := json.Unmarshal(userJSONBytes, &res); err != nil {
32674
-							utils.ErrorLog("解析失败:%v", err)
32675
-							c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
32676
-							return
32700
+							if err := json.Unmarshal(userJSONBytes, &res); err != nil {
32701
+								utils.ErrorLog("解析失败:%v", err)
32702
+								c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
32703
+								return
32704
+							}
32677
 						}
32705
 						}
32678
-
32679
 					}
32706
 					}
32680
-
32681
 				}
32707
 				}
32682
-
32683
 			}
32708
 			}
32684
-
32685
 			var total_two float64
32709
 			var total_two float64
32686
 			if res.Infcode == -1 {
32710
 			if res.Infcode == -1 {
32687
 				errlog := &models.HisOrderError{
32711
 				errlog := &models.HisOrderError{
34029
 							var request_log string
34053
 							var request_log string
34030
 							psn_info, _ := service.GetPsnByPatientId(his.PatientId)
34054
 							psn_info, _ := service.GetPsnByPatientId(his.PatientId)
34031
 							allTotal = fmt.Sprintf("%.2f", total_two)
34055
 							allTotal = fmt.Sprintf("%.2f", total_two)
34032
-							if his.IdCardType == 4 {
34033
-								result, request_log = service.Gdyb2206(his.PsnNo, his.Number, chrg_bchno, psn_info.VerifyNumber, insutype, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, strconv.FormatInt(reg_type, 10), his.IdCardType, 0, 0, 0, 0, his.IdType, admin_user_id)
34056
+							if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" {
34057
+
34058
+								result3101 := Checkgd3102(c, id, his_patient_id, admin_user_id, "6", order.ID)
34059
+								if result3101.Infcode == 0 {
34060
+									if len(result3101.Output.Result) > 0 {
34061
+										var errMsgs []string
34062
+										for _, item := range result3101.Output.Result {
34063
+											errMsgs = append(errMsgs, item.VolaCont)
34064
+
34065
+										}
34066
+										c.ServeSuccessJSON(map[string]interface{}{
34067
+											"failed_code": -10,
34068
+											"msg":         errMsgs,
34069
+										})
34070
+										return
34071
+									} else {
34072
+										var result string
34073
+										var request_log string
34074
+										psn_info, _ := service.GetPsnByPatientId(his.PatientId)
34075
+										allTotal = fmt.Sprintf("%.2f", total_two)
34076
+										if his.IdCardType == 4 {
34077
+											result, request_log = service.Gdyb2206(his.PsnNo, his.Number, chrg_bchno, psn_info.VerifyNumber, insutype, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, strconv.FormatInt(reg_type, 10), his.IdCardType, 0, 0, 0, 0, his.IdType, admin_user_id)
34078
+										} else {
34079
+											result, request_log = service.Gdyb2206(his.PsnNo, his.Number, chrg_bchno, cert_no, insutype, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, strconv.FormatInt(reg_type, 10), his.IdCardType, 0, 0, 0, 0, his.IdType, admin_user_id)
34080
+
34081
+										}
34082
+
34083
+										var dat map[string]interface{}
34084
+										if err := json.Unmarshal([]byte(result), &dat); err == nil {
34085
+											fmt.Println(dat)
34086
+										} else {
34087
+											fmt.Println(err)
34088
+										}
34089
+										saveLog(result, request_log, "2206", "预结算")
34090
+
34091
+									}
34092
+								} else {
34093
+									c.ServeSuccessJSON(map[string]interface{}{
34094
+										"failed_code": -10,
34095
+										"msg":         result3101.ErrMsg,
34096
+									})
34097
+									return
34098
+								}
34034
 							} else {
34099
 							} else {
34035
-								result, request_log = service.Gdyb2206(his.PsnNo, his.Number, chrg_bchno, cert_no, insutype, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, strconv.FormatInt(reg_type, 10), his.IdCardType, 0, 0, 0, 0, his.IdType, admin_user_id)
34100
+								if his.IdCardType == 4 {
34101
+									result, request_log = service.Gdyb2206(his.PsnNo, his.Number, chrg_bchno, psn_info.VerifyNumber, insutype, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, strconv.FormatInt(reg_type, 10), his.IdCardType, 0, 0, 0, 0, his.IdType, admin_user_id)
34102
+								} else {
34103
+									result, request_log = service.Gdyb2206(his.PsnNo, his.Number, chrg_bchno, cert_no, insutype, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, strconv.FormatInt(reg_type, 10), his.IdCardType, 0, 0, 0, 0, his.IdType, admin_user_id)
34036
 
34104
 
34105
+								}
34037
 							}
34106
 							}
34038
 
34107
 
34039
 							var dat map[string]interface{}
34108
 							var dat map[string]interface{}
38716
 		} else if miConfig.MdtrtareaAdmvs == "360302" {
38785
 		} else if miConfig.MdtrtareaAdmvs == "360302" {
38717
 			baseParams.InsuplcAdmdvs = his.InsuplcAdmdvs
38786
 			baseParams.InsuplcAdmdvs = his.InsuplcAdmdvs
38718
 
38787
 
38719
-
38720
 			result, requestLog := service.Jxyb5203(baseParams, businessParams)
38788
 			result, requestLog := service.Jxyb5203(baseParams, businessParams)
38721
 			saveLog(result, requestLog, "5203", "结算单")
38789
 			saveLog(result, requestLog, "5203", "结算单")
38722
 			var dat map[string]interface{}
38790
 			var dat map[string]interface{}
38734
 		} else if miConfig.MdtrtareaAdmvs == "361025" {
38802
 		} else if miConfig.MdtrtareaAdmvs == "361025" {
38735
 			baseParams.InsuplcAdmdvs = his.InsuplcAdmdvs
38803
 			baseParams.InsuplcAdmdvs = his.InsuplcAdmdvs
38736
 
38804
 
38737
-
38738
 			result, requestLog := service.Jxyb5203(baseParams, businessParams)
38805
 			result, requestLog := service.Jxyb5203(baseParams, businessParams)
38739
 			saveLog(result, requestLog, "5203", "结算单")
38806
 			saveLog(result, requestLog, "5203", "结算单")
38740
 			var dat map[string]interface{}
38807
 			var dat map[string]interface{}
39227
 		res.Output.Setlinfo.PsnCashPay = order.PsnCashPay
39294
 		res.Output.Setlinfo.PsnCashPay = order.PsnCashPay
39228
 
39295
 
39229
 		if res.Infcode == 0 {
39296
 		if res.Infcode == 0 {
39230
-			if adminUser.CurrentOrgId == 10215 || adminUser.CurrentOrgId == 10387 || adminUser.CurrentOrgId == 9919 || adminUser.CurrentOrgId == 10088 || adminUser.CurrentOrgId == 10150 || adminUser.CurrentOrgId == 10454 || adminUser.CurrentOrgId == 10644 || adminUser.CurrentOrgId == 10653 || adminUser.CurrentOrgId == 10210{
39297
+			if adminUser.CurrentOrgId == 10215 || adminUser.CurrentOrgId == 10387 || adminUser.CurrentOrgId == 9919 || adminUser.CurrentOrgId == 10088 || adminUser.CurrentOrgId == 10150 || adminUser.CurrentOrgId == 10454 || adminUser.CurrentOrgId == 10644 || adminUser.CurrentOrgId == 10653 || adminUser.CurrentOrgId == 10210 {
39231
 				c.ServeSuccessJSON(map[string]interface{}{
39298
 				c.ServeSuccessJSON(map[string]interface{}{
39232
 					"diagnosis":            name,
39299
 					"diagnosis":            name,
39233
 					"order_infos":          orderInfos,
39300
 					"order_infos":          orderInfos,