Browse Source

Merge branch 'master' of http://git.shengws.com/csx/gdyb

csx 3 years ago
parent
commit
5d944c1103

+ 1 - 1
controllers/sg/gdyb_controller.go View File

@@ -520,7 +520,7 @@ func (c *GdybController) PostZHFive() {
520 520
 		return
521 521
 	}
522 522
 	userJSONBytes, _ := json.Marshal(respJSON["pre"])
523
-	var hp []*models.HisPrescription
523
+	var hp []*models.NewCustom
524 524
 	if err := json.Unmarshal(userJSONBytes, &hp); err != nil {
525 525
 		utils.ErrorLog("解析失败:%v", err)
526 526
 		return

+ 215 - 109
controllers/zh/zh_his_api_controller.go View File

@@ -11,6 +11,7 @@ import (
11 11
 	"gdyb/utils"
12 12
 	"github.com/astaxie/beego"
13 13
 	"io/ioutil"
14
+	"math"
14 15
 	"math/rand"
15 16
 	"net/http"
16 17
 	"strconv"
@@ -241,6 +242,28 @@ type ResultEmpty struct {
241 242
 	WarnMsg     interface{} `json:"warn_msg"`
242 243
 }
243 244
 
245
+type CustomResult struct {
246
+	BasMednFlag      string  `json:"bas_medn_flag"`
247
+	ChldMedcFlag     string  `json:"chld_medc_flag"`
248
+	ChrgitmLv        string  `json:"chrgitm_lv"`
249
+	Cnt              float64 `json:"cnt"`
250
+	DetItemFeeSumamt float64 `json:"det_item_fee_sumamt"`
251
+	DrtReimFlag      string  `json:"drt_reim_flag"`
252
+	FeedetlSn        string  `json:"feedetl_sn"`
253
+	FulamtOwnpayAmt  float64 `json:"fulamt_ownpay_amt"`
254
+	HiNegoDrugFlag   string  `json:"hi_nego_drug_flag"`
255
+	InscpScpAmt      float64 `json:"inscp_scp_amt"`
256
+	ListSpItemFlag   string  `json:"list_sp_item_flag"`
257
+	LmtUsedFlag      string  `json:"lmt_used_flag"`
258
+	MedChrgitmType   string  `json:"med_chrgitm_type"`
259
+	Memo             string  `json:"memo"`
260
+	OverlmtAmt       float64 `json:"overlmt_amt"`
261
+	PreselfpayAmt    float64 `json:"preselfpay_amt"`
262
+	Pric             float64 `json:"pric"`
263
+	PricUplmtAmt     float64 `json:"pric_uplmt_amt"`
264
+	SelfpayProp      float64 `json:"selfpay_prop"`
265
+}
266
+
244 267
 func ZHHisManagerApiRegistRouters() {
245 268
 	beego.Router("/zh/api/inhopitalcheck/get", &ZHHisApiController{}, "get:GetZHInHospitalCheck")
246 269
 	beego.Router("/zh/api/outhopitalcheck/get", &ZHHisApiController{}, "get:GetZHOutHospitalCheck")
@@ -818,7 +841,6 @@ func (c *ZHHisApiController) GetUploadInfo() {
818 841
 	data := make(map[string]interface{})
819 842
 	if settle_accounts_type == 1 { //日结
820 843
 		prescriptions, _ = service.GetZHHisPrescription(adminUser.CurrentOrgId, id, recordDateTime)
821
-		data["pre"] = prescriptions
822 844
 
823 845
 	} else { //月结
824 846
 		start_time_str := c.GetString("start_time")
@@ -840,7 +862,6 @@ func (c *ZHHisApiController) GetUploadInfo() {
840 862
 		recordEndTime := theEndTime.Unix()
841 863
 		end_time = recordEndTime
842 864
 		prescriptions, _ = service.GetZHMonthHisPrescription(adminUser.CurrentOrgId, id, recordStartTime, recordEndTime)
843
-		data["pre"] = prescriptions
844 865
 
845 866
 	}
846 867
 
@@ -894,56 +915,157 @@ func (c *ZHHisApiController) GetUploadInfo() {
894 915
 	}
895 916
 	config, _ := service.GetMedicalInsuranceConfig(adminUser.CurrentOrgId)
896 917
 	if config.IsOpen == 1 { //对接了医保,走医保流程
897
-		bytesData, _ := json.Marshal(data)
898
-		req, _ := http.NewRequest("POST", "http://127.0.0.1:9532/"+"gdyb/zh/five", bytes.NewReader(bytesData))
899
-		resp, _ := client.Do(req)
900
-		defer resp.Body.Close()
901
-		body, ioErr := ioutil.ReadAll(resp.Body)
902
-		if ioErr != nil {
903
-			utils.ErrorLog("接口返回数据读取失败: %v", ioErr)
904
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
905
-			return
906
-		}
907
-		var respJSON map[string]interface{}
908
-		if err := json.Unmarshal([]byte(body), &respJSON); err != nil {
909
-			utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
910
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
911
-			return
912
-		}
913 918
 
914
-		respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
915
-		userJSONBytes, _ := json.Marshal(respJSON)
916
-		var res ResultFour
917
-		if err := json.Unmarshal(userJSONBytes, &res); err != nil {
918
-			utils.ErrorLog("解析失败:%v", err)
919
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
920
-			return
921
-		}
919
+		var pagesize int = 100
920
+		var start int = 1
921
+		var stop int
922
+		var pagecount int
923
+		var curpage int
924
+		var isSuccess bool = true
925
+
926
+		var customs []*models.NewCustom
922 927
 
923
-		var total float64
924 928
 		for _, item := range prescriptions {
925 929
 			if item.Type == 1 { //药品
926 930
 				for _, subItem := range item.HisDoctorAdviceInfo {
927
-					total = total + (subItem.Price * subItem.PrescribingNumber)
931
+					if len(subItem.BaseDrugLib.MedicalInsuranceNumber) > 0 {
932
+						//var randNum int
933
+						//randNum = rand.Intn(10000) + 1000
934
+						cus := &models.NewCustom{
935
+							DetItemFeeSumamt: fmt.Sprintf("%.2f", subItem.Price*subItem.PrescribingNumber),
936
+							Cut:              fmt.Sprintf("%.2f", subItem.PrescribingNumber),
937
+							FeedetlSn:        subItem.FeedetlSn,
938
+							Price:            fmt.Sprintf("%.2f", subItem.Price),
939
+							MedListCodg:      subItem.BaseDrugLib.MedicalInsuranceNumber,
940
+							HospApprFlag:     subItem.BaseDrugLib.HospApprFlag,
941
+						}
942
+
943
+						customs = append(customs, cus)
944
+					}
928 945
 				}
929 946
 			}
947
+
930 948
 			if item.Type == 2 { //项目
931 949
 				for _, subItem := range item.HisPrescriptionProject {
932
-					total = total + (subItem.Price * float64(subItem.Count))
950
+					//var randNum int
951
+					//randNum = rand.Intn(10000) + 1000
952
+					if len(subItem.HisProject.MedicalCode) > 0 {
953
+
954
+						cus := &models.NewCustom{
955
+							DetItemFeeSumamt: fmt.Sprintf("%.2f", subItem.Price*float64(subItem.Count)),
956
+							Cut:              fmt.Sprintf("%.2f", float64(subItem.Count)),
957
+							FeedetlSn:        subItem.FeedetlSn,
958
+							Price:            fmt.Sprintf("%.2f", float64(subItem.Price)),
959
+							MedListCodg:      subItem.HisProject.MedicalCode,
960
+							HospApprFlag:     -1,
961
+						}
962
+						customs = append(customs, cus)
963
+					}
933 964
 				}
934 965
 			}
935
-		}
936 966
 
937
-		for _, item := range prescriptions {
938 967
 			for _, subItem := range item.HisAdditionalCharge {
939
-				total = total + (subItem.Price * float64(subItem.Count))
968
+				if len(subItem.XtHisAddtionConfig.Code) > 0 {
969
+					cus := &models.NewCustom{
970
+						DetItemFeeSumamt: fmt.Sprintf("%.2f", subItem.Price*float64(subItem.Count)),
971
+						Cut:              fmt.Sprintf("%.2f", float64(subItem.Count)),
972
+						FeedetlSn:        subItem.FeedetlSn,
973
+						Price:            fmt.Sprintf("%.2f", float64(subItem.Price)),
974
+						MedListCodg:      subItem.XtHisAddtionConfig.Code,
975
+						HospApprFlag:     -1,
976
+					}
977
+					customs = append(customs, cus)
978
+				}
940 979
 			}
941 980
 		}
942 981
 
943
-		allTotal := fmt.Sprintf("%.2f", total)
982
+		//总页数,向上取整,注意除之前要先转换类型为float64
983
+		pagecount = int(math.Ceil(float64(len(customs)) / float64(pagesize)))
984
+		var ress []*ResultFour
985
+		for curpage = 1; curpage <= pagecount; curpage++ {
986
+			if curpage == 1 {
987
+				start = 1
988
+			} else {
989
+				start = (curpage-1)*pagesize + 1
990
+			}
991
+			stop = curpage * pagesize
992
+			if stop > len(customs) {
993
+				stop = len(customs)
994
+			}
995
+
996
+			data["pre"] = customs[start-1 : stop]
997
+			bytesData, _ := json.Marshal(data)
998
+			req, _ := http.NewRequest("POST", "http://127.0.0.1:9532/"+"gdyb/zh/five", bytes.NewReader(bytesData))
999
+			resp, _ := client.Do(req)
1000
+			defer resp.Body.Close()
1001
+			body, ioErr := ioutil.ReadAll(resp.Body)
1002
+			if ioErr != nil {
1003
+				utils.ErrorLog("接口返回数据读取失败: %v", ioErr)
1004
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
1005
+				return
1006
+			}
1007
+			var respJSON map[string]interface{}
1008
+			if err := json.Unmarshal([]byte(body), &respJSON); err != nil {
1009
+				utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
1010
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
1011
+				return
1012
+			}
1013
+
1014
+			respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
1015
+			userJSONBytes, _ := json.Marshal(respJSON)
1016
+			var res ResultFour
1017
+			if err := json.Unmarshal(userJSONBytes, &res); err != nil {
1018
+				utils.ErrorLog("解析失败:%v", err)
1019
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
1020
+				return
1021
+			}
1022
+
1023
+			if res.Infcode == 0 {
1024
+				ress = append(ress, &res)
1025
+			} else {
1026
+				isSuccess = false
1027
+				errlog := &models.HisOrderError{
1028
+					UserOrgId:  adminUser.CurrentOrgId,
1029
+					Ctime:      time.Now().Unix(),
1030
+					Mtime:      time.Now().Unix(),
1031
+					Number:     chrg_bchno,
1032
+					ErrMsg:     "",
1033
+					Status:     1,
1034
+					PatientId:  id,
1035
+					RecordTime: recordDateTime,
1036
+					Stage:      4,
1037
+				}
1038
+				service.CreateErrMsgLog(errlog)
1039
+				c.ServeSuccessJSON(map[string]interface{}{
1040
+					"failed_code": -10,
1041
+					"msg":         "上传明细错误,请联系his厂商",
1042
+				})
1043
+				return
1044
+			}
1045
+		}
1046
+
1047
+		if isSuccess == true {
1048
+			var total float64
1049
+			for _, item := range prescriptions {
1050
+				if item.Type == 1 { //药品
1051
+					for _, subItem := range item.HisDoctorAdviceInfo {
1052
+						total = total + (subItem.Price * subItem.PrescribingNumber)
1053
+					}
1054
+				}
1055
+				if item.Type == 2 { //项目
1056
+					for _, subItem := range item.HisPrescriptionProject {
1057
+						total = total + (subItem.Price * float64(subItem.Count))
1058
+					}
1059
+				}
1060
+			}
1061
+			for _, item := range prescriptions {
1062
+				for _, subItem := range item.HisAdditionalCharge {
1063
+					total = total + (subItem.Price * float64(subItem.Count))
1064
+				}
1065
+			}
1066
+			allTotal := fmt.Sprintf("%.2f", total)
1067
+			totals, _ := strconv.ParseFloat(allTotal, 64)
944 1068
 
945
-		totals, _ := strconv.ParseFloat(allTotal, 64)
946
-		if res.Infcode == 0 {
947 1069
 			order := &models.HisOrder{
948 1070
 				UserOrgId:           adminUser.CurrentOrgId,
949 1071
 				HisPatientId:        record.ID,
@@ -953,12 +1075,12 @@ func (c *ZHHisApiController) GetUploadInfo() {
953 1075
 				Mtime:               time.Now().Unix(),
954 1076
 				Status:              1,
955 1077
 				Number:              chrg_bchno,
956
-				Infcode:             res.Infcode,
957
-				WarnMsg:             res.WarnMsg,
958
-				Cainfo:              res.Cainfo,
959
-				ErrMsg:              res.ErrMsg,
960
-				RespondTime:         res.RefmsgTime,
961
-				InfRefmsgid:         res.InfRefmsgid,
1078
+				Infcode:             0,
1079
+				WarnMsg:             "",
1080
+				Cainfo:              "",
1081
+				ErrMsg:              "",
1082
+				RespondTime:         "",
1083
+				InfRefmsgid:         "",
962 1084
 				OrderStatus:         1,
963 1085
 				MdtrtId:             record.Number,
964 1086
 				IsMedicineInsurance: 1,
@@ -975,82 +1097,66 @@ func (c *ZHHisApiController) GetUploadInfo() {
975 1097
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreatePreOrderException)
976 1098
 				return
977 1099
 			}
978
-
979
-			for _, item := range res.Output.Result {
980
-				temp := strings.Split(item.FeedetlSn, "-")
981
-				var advice_id int64 = 0
982
-				var project_id int64 = 0
983
-				var types int64 = 0
984
-
985
-				id, _ := strconv.ParseInt(temp[2], 10, 64)
986
-				types, _ = strconv.ParseInt(temp[1], 10, 64)
987
-
988
-				if temp[1] == "1" {
989
-					advice_id = id
990
-					project_id = 0
991
-				} else if temp[1] == "2" {
992
-					advice_id = 0
993
-					project_id = id
994
-				}
995
-				info := &models.HisOrderInfo{
996
-					OrderNumber:      order.Number,
997
-					FeedetlSn:        item.FeedetlSn,
998
-					UploadDate:       time.Now().Unix(),
999
-					AdviceId:         advice_id,
1000
-					DetItemFeeSumamt: item.DetItemFeeSumamt,
1001
-					Cnt:              item.Cnt,
1002
-					Pric:             float64(item.Pric),
1003
-					PatientId:        record.PatientId,
1004
-					PricUplmtAmt:     item.PricUplmtAmt,
1005
-					SelfpayProp:      item.SelfpayProp,
1006
-					FulamtOwnpayAmt:  item.FulamtOwnpayAmt,
1007
-					OverlmtAmt:       item.OverlmtAmt,
1008
-					PreselfpayAmt:    item.PreselfpayAmt,
1009
-					BasMednFlag:      item.BasMednFlag,
1010
-					MedChrgitmType:   item.MedChrgitmType,
1011
-					HiNegoDrugFlag:   item.HiNegoDrugFlag,
1012
-					Status:           1,
1013
-					Memo:             item.Memo,
1014
-					Mtime:            time.Now().Unix(),
1015
-					InscpScpAmt:      item.InscpScpAmt,
1016
-					DrtReimFlag:      item.DrtReimFlag,
1017
-					Ctime:            time.Now().Unix(),
1018
-					ListSpItemFlag:   item.ListSpItemFlag,
1019
-					ChldMedcFlag:     item.ChldMedcFlag,
1020
-					LmtUsedFlag:      item.LmtUsedFlag,
1021
-					ChrgitmLv:        item.ChrgitmLv,
1022
-					UserOrgId:        adminUser.CurrentOrgId,
1023
-					HisPatientId:     record.ID,
1024
-					OrderId:          order.ID,
1025
-					ProjectId:        project_id,
1026
-					Type:             types,
1100
+			for _, subItem := range ress {
1101
+				for _, item := range subItem.Output.Result {
1102
+					temp := strings.Split(item.FeedetlSn, "-")
1103
+					var advice_id int64 = 0
1104
+					var project_id int64 = 0
1105
+					var types int64 = 0
1106
+
1107
+					id, _ := strconv.ParseInt(temp[2], 10, 64)
1108
+					types, _ = strconv.ParseInt(temp[1], 10, 64)
1109
+
1110
+					if temp[1] == "1" {
1111
+						advice_id = id
1112
+						project_id = 0
1113
+					} else if temp[1] == "2" {
1114
+						advice_id = 0
1115
+						project_id = id
1116
+					}
1117
+					info := &models.HisOrderInfo{
1118
+						OrderNumber:      order.Number,
1119
+						FeedetlSn:        item.FeedetlSn,
1120
+						UploadDate:       time.Now().Unix(),
1121
+						AdviceId:         advice_id,
1122
+						DetItemFeeSumamt: item.DetItemFeeSumamt,
1123
+						Cnt:              item.Cnt,
1124
+						Pric:             float64(item.Pric),
1125
+						PatientId:        record.PatientId,
1126
+						PricUplmtAmt:     item.PricUplmtAmt,
1127
+						SelfpayProp:      item.SelfpayProp,
1128
+						FulamtOwnpayAmt:  item.FulamtOwnpayAmt,
1129
+						OverlmtAmt:       item.OverlmtAmt,
1130
+						PreselfpayAmt:    item.PreselfpayAmt,
1131
+						BasMednFlag:      item.BasMednFlag,
1132
+						MedChrgitmType:   item.MedChrgitmType,
1133
+						HiNegoDrugFlag:   item.HiNegoDrugFlag,
1134
+						Status:           1,
1135
+						Memo:             item.Memo,
1136
+						Mtime:            time.Now().Unix(),
1137
+						InscpScpAmt:      item.InscpScpAmt,
1138
+						DrtReimFlag:      item.DrtReimFlag,
1139
+						Ctime:            time.Now().Unix(),
1140
+						ListSpItemFlag:   item.ListSpItemFlag,
1141
+						ChldMedcFlag:     item.ChldMedcFlag,
1142
+						LmtUsedFlag:      item.LmtUsedFlag,
1143
+						ChrgitmLv:        item.ChrgitmLv,
1144
+						UserOrgId:        adminUser.CurrentOrgId,
1145
+						HisPatientId:     record.ID,
1146
+						OrderId:          order.ID,
1147
+						ProjectId:        project_id,
1148
+						Type:             types,
1149
+					}
1150
+					service.CreateOrderInfo(info)
1027 1151
 				}
1028
-				service.CreateOrderInfo(info)
1029 1152
 			}
1030 1153
 			service.UpDatePrescriptionNumber(adminUser.CurrentOrgId, ids, chrg_bchno)
1031 1154
 			service.UpDatePrescriptionInfoNumber(adminUser.CurrentOrgId, patientPrescription.PatientId, chrg_bchno, recordDateTime)
1032 1155
 			c.ServeSuccessJSON(map[string]interface{}{
1033 1156
 				"msg": "上传费用明细成功",
1034 1157
 			})
1035
-		} else {
1036
-			adminUser := c.GetAdminUserInfo()
1037
-			errlog := &models.HisOrderError{
1038
-				UserOrgId:  adminUser.CurrentOrgId,
1039
-				Ctime:      time.Now().Unix(),
1040
-				Mtime:      time.Now().Unix(),
1041
-				ErrMsg:     res.ErrMsg,
1042
-				Status:     1,
1043
-				PatientId:  id,
1044
-				RecordTime: recordDateTime,
1045
-				Stage:      4,
1046
-			}
1047
-			service.CreateErrMsgLog(errlog)
1048
-			c.ServeSuccessJSON(map[string]interface{}{
1049
-				"failed_code": -10,
1050
-				"msg":         res.ErrMsg,
1051
-			})
1052
-			return
1053 1158
 		}
1159
+
1054 1160
 	}
1055 1161
 }
1056 1162
 func (c *ZHHisApiController) ZHRefund() {

+ 10 - 0
models/his_models.go View File

@@ -1240,3 +1240,13 @@ type HisFundSettleListResult struct {
1240 1240
 func (HisFundSettleListResult) TableName() string {
1241 1241
 	return "his_fund_settle_list_result"
1242 1242
 }
1243
+
1244
+type NewCustom struct {
1245
+	DetItemFeeSumamt string
1246
+	Cut              string
1247
+	FeedetlSn        string
1248
+	Price            string
1249
+	MedListCodg      string
1250
+	LmtUsedFlag      int64
1251
+	HospApprFlag     int64
1252
+}

+ 3 - 56
service/zh_his_service.go View File

@@ -528,7 +528,7 @@ type ZHResult struct {
528 528
 }
529 529
 
530 530
 //  住院费用明细信息上传
531
-func ZHGdyb2301(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescription, chrg_bchno string, org_name string, doctor string, dept string, fixmedins_code string, dept_code string, doctor_id string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, med_type string) string {
531
+func ZHGdyb2301(psnNo string, mdtrtId string, hisPrescription []*models.NewCustom, chrg_bchno string, org_name string, doctor string, dept string, fixmedins_code string, dept_code string, doctor_id string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, med_type string) string {
532 532
 	// 生成签名
533 533
 	nonce := GetRandomString(32)
534 534
 	timestamp := time.Now().Unix()
@@ -538,62 +538,9 @@ func ZHGdyb2301(psnNo string, mdtrtId string, hisPrescription []*models.HisPresc
538 538
 	timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
539 539
 	//chrgBchno := rand.Intn(100000) + 10000
540 540
 
541
-	var customs []*Custom
542
-
543
-	for _, item := range hisPrescription {
544
-		if item.Type == 1 { //药品
545
-			for _, subItem := range item.HisDoctorAdviceInfo {
546
-				if len(subItem.BaseDrugLib.MedicalInsuranceNumber) > 0 {
547
-					//var randNum int
548
-					//randNum = rand.Intn(10000) + 1000
549
-					cus := &Custom{
550
-						DetItemFeeSumamt: fmt.Sprintf("%.2f", subItem.Price*subItem.PrescribingNumber),
551
-						Cut:              fmt.Sprintf("%.2f", subItem.PrescribingNumber),
552
-						FeedetlSn:        subItem.FeedetlSn,
553
-						Price:            fmt.Sprintf("%.2f", subItem.Price),
554
-						MedListCodg:      subItem.BaseDrugLib.MedicalInsuranceNumber,
555
-						HospApprFlag:     subItem.BaseDrugLib.HospApprFlag,
556
-					}
557
-
558
-					customs = append(customs, cus)
559
-				}
560
-			}
561
-		}
562
-
563
-		if item.Type == 2 { //项目
564
-			for _, subItem := range item.HisPrescriptionProject {
565
-				//var randNum int
566
-				//randNum = rand.Intn(10000) + 1000
567
-				if len(subItem.HisProject.MedicalCode) > 0 {
568
-
569
-					cus := &Custom{
570
-						DetItemFeeSumamt: fmt.Sprintf("%.2f", subItem.Price*float64(subItem.Count)),
571
-						Cut:              fmt.Sprintf("%.2f", float64(subItem.Count)),
572
-						FeedetlSn:        subItem.FeedetlSn,
573
-						Price:            fmt.Sprintf("%.2f", float64(subItem.Price)),
574
-						MedListCodg:      subItem.HisProject.MedicalCode,
575
-						HospApprFlag:     -1,
576
-					}
577
-					customs = append(customs, cus)
578
-				}
579
-			}
580
-		}
581
-
582
-		for _, subItem := range item.HisAdditionalCharge {
583
-			if len(subItem.XtHisAddtionConfig.Code) > 0 {
584
-				cus := &Custom{
585
-					DetItemFeeSumamt: fmt.Sprintf("%.2f", subItem.Price*float64(subItem.Count)),
586
-					Cut:              fmt.Sprintf("%.2f", float64(subItem.Count)),
587
-					FeedetlSn:        subItem.FeedetlSn,
588
-					Price:            fmt.Sprintf("%.2f", float64(subItem.Price)),
589
-					MedListCodg:      subItem.XtHisAddtionConfig.Code,
590
-					HospApprFlag:     -1,
591
-				}
592
-				customs = append(customs, cus)
593
-			}
594
-		}
595
-	}
541
+	var customs []*models.NewCustom
596 542
 
543
+	customs = hisPrescription
597 544
 	// 生成输入报文
598 545
 	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
599 546
 	input := make(map[string]interface{})