|
@@ -58,13 +58,13 @@ type ResultEmpty10265 struct {
|
58
|
58
|
func init() {
|
59
|
59
|
//service.ConnectNMMSDB()
|
60
|
60
|
service.ConnectDB()
|
61
|
|
- org_id, _ := beego.AppConfig.Int64("org_id")
|
62
|
|
- miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
|
63
|
|
- //CreateLog(miConfig)
|
64
|
|
- //UploadLog(miConfig)31
|
65
|
|
- if org_id == 10191 {
|
66
|
|
- service.GetFjAuthorizationInfo(miConfig.Code)
|
67
|
|
- }
|
|
61
|
+ //org_id, _ := beego.AppConfig.Int64("org_id")
|
|
62
|
+ //miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
|
|
63
|
+ ////CreateLog(miConfig)
|
|
64
|
+ ////UploadLog(miConfig)31
|
|
65
|
+ //if org_id == 10191 {
|
|
66
|
+ // service.GetFjAuthorizationInfo(miConfig.Code)
|
|
67
|
+ //}
|
68
|
68
|
}
|
69
|
69
|
func main() {
|
70
|
70
|
//service.AutoCreateStock()
|
|
@@ -78,6 +78,8 @@ func main() {
|
78
|
78
|
//深圳百霖
|
79
|
79
|
//GetblBatchSettleList()
|
80
|
80
|
//GetblpgBatchSettleList()
|
|
81
|
+ //GetgaBatchSettleList()
|
|
82
|
+ //GetlsBatchSettleList()
|
81
|
83
|
|
82
|
84
|
//GetblbrBatchSettleList()
|
83
|
85
|
//深圳百霖贝尔
|
|
@@ -709,10 +711,231 @@ type ResultSeventeen struct {
|
709
|
711
|
//
|
710
|
712
|
func GetblBatchSettleList() {
|
711
|
713
|
org_id, _ := beego.AppConfig.Int64("org_id")
|
712
|
|
- org_id = 9504
|
|
714
|
+ org_id = 10138
|
713
|
715
|
var orders []*models.HisOrder
|
714
|
716
|
//var orders []*models.HisOrderError
|
715
|
717
|
orders, _ = service.GetAllHisOrder10138()
|
|
718
|
+ for _, item := range orders {
|
|
719
|
+ order_id := item.ID
|
|
720
|
+ order, _ := service.GetHisOrderByIDTwo(order_id)
|
|
721
|
+ if order.MedType == "14" {
|
|
722
|
+ his, _ := service.GetHisPatientByNumber(order.MdtrtId)
|
|
723
|
+ var patientPrescription models.HisPrescriptionInfo
|
|
724
|
+ patientPrescription, _ = service.FindLastPatientPrescriptionInfo(order.UserOrgId, order.PatientId, order.SettleAccountsDate)
|
|
725
|
+ doctor_info, _ := service.GetAdminUserInfoByID(order.UserOrgId, patientPrescription.DoctorId)
|
|
726
|
+ department, _ := service.GetDepartMentDetail(patientPrescription.Departments)
|
|
727
|
+ miConfig, _ := service.FindMedicalInsuranceInfo(order.UserOrgId)
|
|
728
|
+ var configTwo []*models.HisXtDiagnoseConfig
|
|
729
|
+ diagnosis_idstwo := strings.Split(his.Diagnosis, ",")
|
|
730
|
+ curRoles, _ := service.GetAdminUserInfoByID(org_id, 2185)
|
|
731
|
+ for _, item := range diagnosis_idstwo {
|
|
732
|
+ id, _ := strconv.ParseInt(item, 10, 64)
|
|
733
|
+ diagnosisConfig, _ := service.FindDiagnoseById(id)
|
|
734
|
+ configTwo = append(configTwo, &diagnosisConfig)
|
|
735
|
+ }
|
|
736
|
+ patient, _ := service.GetPatientByIDTwo(10138, order.PatientId)
|
|
737
|
+
|
|
738
|
+ sickConfig, _ := service.FindSickById(his.SickType)
|
|
739
|
+ //if order.MedType == "1111" || order.MedType == "1112" {
|
|
740
|
+ // order.MedType = "11"
|
|
741
|
+ //}
|
|
742
|
+ service.Gdyb2203d(his.PsnNo, his.Number, doctor_info.UserName, department.Name, miConfig.OrgName, "14", doctor_info.DoctorNumber, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.ContentCode, sickConfig.ClassName, curRoles.UserName, configTwo, time.Unix(his.RecordDate, 0).Format("2006-01-02 15:04:05"))
|
|
743
|
+
|
|
744
|
+ depart, _ := service.GetDepartMentDetail(curRoles.DepartmentId)
|
|
745
|
+ pre, _ := service.GetNewHisPrescriptionByNumber(order.Number)
|
|
746
|
+ doctor, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
|
|
747
|
+ if order.ID == 0 {
|
|
748
|
+ return
|
|
749
|
+ }
|
|
750
|
+ if his.BalanceAccountsType == 2 {
|
|
751
|
+ continue
|
|
752
|
+ }
|
|
753
|
+
|
|
754
|
+ ID := strconv.FormatInt(int64(order.ID), 10)
|
|
755
|
+
|
|
756
|
+ struct4101 := service.Struct4101{
|
|
757
|
+ PsnNo: order.PsnNo,
|
|
758
|
+ MdtrtId: order.MdtrtId,
|
|
759
|
+ SetlId: order.SetlId,
|
|
760
|
+ PsnName: order.PsnName,
|
|
761
|
+ Gend: order.Gend,
|
|
762
|
+ Brdy: his.Brdy,
|
|
763
|
+ Age: his.Age,
|
|
764
|
+ Naty: order.Naty,
|
|
765
|
+ PatnCertType: order.PsnCertType,
|
|
766
|
+ Certno: order.Certno,
|
|
767
|
+ Prfs: "90",
|
|
768
|
+ ConerName: "",
|
|
769
|
+ PatnRlts: "",
|
|
770
|
+ ConerAddr: "",
|
|
771
|
+ ConerTel: "",
|
|
772
|
+ HiType: order.Insutype,
|
|
773
|
+ Insuplc: his.InsuplcAdmdvs,
|
|
774
|
+ MaindiagFlag: "1",
|
|
775
|
+ BillCode: "000"+ID,
|
|
776
|
+ BillNo: "000"+ID,
|
|
777
|
+ BizSn: order.Number,
|
|
778
|
+ PsnSelfPay: order.PsnPartAmt,
|
|
779
|
+ PsnOwnPay: order.PsnPartAmt,
|
|
780
|
+ AcctPay: order.AcctPay,
|
|
781
|
+ PsnCashpay: order.PsnCashPay,
|
|
782
|
+ HiPaymtd: "1",
|
|
783
|
+ Hsorg: his.InsuplcAdmdvs,
|
|
784
|
+ HsorgOpter: his.InsuplcAdmdvs,
|
|
785
|
+ MedinsFillPsn: curRoles.UserName,
|
|
786
|
+ MedinsFillDept: depart.Name,
|
|
787
|
+ IptMedType: "2",
|
|
788
|
+ CurAddr: patient.HomeAddress,
|
|
789
|
+ }
|
|
790
|
+
|
|
791
|
+ struct4101.SetlBegnDate = order.SetlTime
|
|
792
|
+ struct4101.SetlEndDate = order.SetlTime
|
|
793
|
+
|
|
794
|
+ var rf []CustomFundPay
|
|
795
|
+ json.Unmarshal([]byte(order.SetlDetail), &rf)
|
|
796
|
+
|
|
797
|
+ //var tempFunPays []service.CustomStruct
|
|
798
|
+ //var tempFunPay610100 service.CustomStruct
|
|
799
|
+
|
|
800
|
+ //for _, item := range rf {
|
|
801
|
+ // if item.FundPayType == "610100" {
|
|
802
|
+ // tempFunPay610100.FundPayamt, _ = decimal.NewFromFloat(tempFunPay610100.FundPayamt).Add(decimal.NewFromFloat(item.FundPayamt)).Float64()
|
|
803
|
+ // tempFunPay610100.FundPayType = item.FundPayType
|
|
804
|
+ // } else {
|
|
805
|
+ // var tempFunPay service.CustomStruct
|
|
806
|
+ // tempFunPay.FundPayamt = item.FundPayamt
|
|
807
|
+ // tempFunPay.FundPayType = item.FundPayType
|
|
808
|
+ // tempFunPays = append(tempFunPays, tempFunPay)
|
|
809
|
+ // }
|
|
810
|
+ //}
|
|
811
|
+ //tempFunPays = append(tempFunPays, tempFunPay610100)
|
|
812
|
+ //struct4101.CustomStruct = tempFunPays
|
|
813
|
+
|
|
814
|
+ var tempDiaginfos []service.DiaginfoStructTwo
|
|
815
|
+ var tempOpspdiseinfo2 service.OpspdiseinfoStruct
|
|
816
|
+ var tempOpspdiseinfos []service.OpspdiseinfoStruct
|
|
817
|
+
|
|
818
|
+ diagnosis_ids := strings.Split(his.Diagnosis, ",")
|
|
819
|
+ var config []*models.HisXtDiagnoseConfig
|
|
820
|
+ for _, item := range diagnosis_ids {
|
|
821
|
+ id, _ := strconv.ParseInt(item, 10, 64)
|
|
822
|
+ if id == 24 {
|
|
823
|
+
|
|
824
|
+ diagnosisConfig, _ := service.FindDiagnoseById(id)
|
|
825
|
+ config = append(config, &diagnosisConfig)
|
|
826
|
+ }
|
|
827
|
+
|
|
828
|
+ }
|
|
829
|
+
|
|
830
|
+ for _, item := range diagnosis_ids {
|
|
831
|
+
|
|
832
|
+ id, _ := strconv.ParseInt(item, 10, 64)
|
|
833
|
+ if id != 24 {
|
|
834
|
+ diagnosisConfig, _ := service.FindDiagnoseById(id)
|
|
835
|
+ config = append(config, &diagnosisConfig)
|
|
836
|
+ }
|
|
837
|
+
|
|
838
|
+ }
|
|
839
|
+
|
|
840
|
+ for index, item := range config {
|
|
841
|
+ if index == 0 {
|
|
842
|
+ var tempDiaginfo service.DiaginfoStructTwo
|
|
843
|
+ tempDiaginfo.DiagCode = item.CountryCode
|
|
844
|
+ tempDiaginfo.DiagName = item.CountryContentName
|
|
845
|
+ tempDiaginfo.DiagType = "1"
|
|
846
|
+ tempDiaginfo.MaindiagFlag = "1"
|
|
847
|
+ tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
|
|
848
|
+ } else {
|
|
849
|
+
|
|
850
|
+ var tempDiaginfo service.DiaginfoStructTwo
|
|
851
|
+ tempDiaginfo.DiagCode = item.CountryCode
|
|
852
|
+ tempDiaginfo.DiagName = item.CountryContentName
|
|
853
|
+ tempDiaginfo.DiagType = "1"
|
|
854
|
+ tempDiaginfo.MaindiagFlag = "0"
|
|
855
|
+ tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
|
|
856
|
+ }
|
|
857
|
+ }
|
|
858
|
+ struct4101.Diseinfo = tempDiaginfos
|
|
859
|
+ sickConfigTwo, _ := service.FindSickById(his.SickType)
|
|
860
|
+ tempOpspdiseinfo2.DiagCode = sickConfigTwo.ContentCode
|
|
861
|
+ tempOpspdiseinfo2.DiagName = sickConfigTwo.CountryContentName
|
|
862
|
+ tempOpspdiseinfo2.OprnOprtCode = ""
|
|
863
|
+ tempOpspdiseinfo2.OprnOprtName = ""
|
|
864
|
+ tempOpspdiseinfos = append(tempOpspdiseinfos, tempOpspdiseinfo2)
|
|
865
|
+ struct4101.OpspdiseinfoStruct = tempOpspdiseinfos
|
|
866
|
+ time_arr := strings.Split(order.SetlTime, " ")
|
|
867
|
+ struct4101.AdmTime = time_arr[0]
|
|
868
|
+ struct4101.AdmEndTime = time_arr[0]
|
|
869
|
+ struct4101.DoctorName = doctor.UserName
|
|
870
|
+ struct4101.DoctorCode = doctor.DoctorNumber
|
|
871
|
+
|
|
872
|
+ struct4101.Ntly = "CHN"
|
|
873
|
+ struct4101.AdmCaty = "A03.06"
|
|
874
|
+ var res ResultSeventeen
|
|
875
|
+
|
|
876
|
+ result, request := service.Gdyb4101For10138(struct4101, miConfig.SecretKey, miConfig.OrgName, curRoles.UserName, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, org_id)
|
|
877
|
+ fmt.Println(result)
|
|
878
|
+ saveLog(result, request, "4101A", "清单上传")
|
|
879
|
+ var dat map[string]interface{}
|
|
880
|
+ if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
|
881
|
+ fmt.Println(dat)
|
|
882
|
+ } else {
|
|
883
|
+ fmt.Println(err)
|
|
884
|
+ }
|
|
885
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
886
|
+ if err := json.Unmarshal(userJSONBytes, &res); err != nil {
|
|
887
|
+ //utils.ErrorLog("解析失败:%v", err)
|
|
888
|
+ //c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
889
|
+ //adminUser := c.GetAdminUserInfo()
|
|
890
|
+ errlog := &models.HisOrderError{
|
|
891
|
+ UserOrgId: org_id,
|
|
892
|
+ Ctime: time.Now().Unix(),
|
|
893
|
+ Mtime: time.Now().Unix(),
|
|
894
|
+ ErrMsg: res.ErrMsg + "解析失败",
|
|
895
|
+ Status: 1,
|
|
896
|
+ PatientId: order_id,
|
|
897
|
+ Stage: 10138600,
|
|
898
|
+ }
|
|
899
|
+ service.CreateErrMsgLog(errlog)
|
|
900
|
+ continue
|
|
901
|
+ }
|
|
902
|
+
|
|
903
|
+ if res.Infcode != 0 {
|
|
904
|
+ //adminUser := c.GetAdminUserInfo()
|
|
905
|
+ errlog := &models.HisOrderError{
|
|
906
|
+ UserOrgId: org_id,
|
|
907
|
+ Ctime: time.Now().Unix(),
|
|
908
|
+ Mtime: time.Now().Unix(),
|
|
909
|
+ ErrMsg: res.ErrMsg,
|
|
910
|
+ Status: 1,
|
|
911
|
+ PatientId: order_id,
|
|
912
|
+ Stage: 10138600,
|
|
913
|
+ }
|
|
914
|
+ service.CreateErrMsgLog(errlog)
|
|
915
|
+ continue
|
|
916
|
+ } else {
|
|
917
|
+ hisFundSettleListResult := &models.HisFundSettleListResult{
|
|
918
|
+ Number: res.Output.SetlListId,
|
|
919
|
+ Status: 1,
|
|
920
|
+ Ctime: time.Now().Unix(),
|
|
921
|
+ Mtime: time.Now().Unix(),
|
|
922
|
+ UserOrgId: org_id,
|
|
923
|
+ IsUpload: 1,
|
|
924
|
+ OrderId: order_id,
|
|
925
|
+ }
|
|
926
|
+ service.CreateUploadRecord(hisFundSettleListResult)
|
|
927
|
+ continue
|
|
928
|
+ }
|
|
929
|
+ }
|
|
930
|
+ }
|
|
931
|
+}
|
|
932
|
+
|
|
933
|
+func GetgaBatchSettleList() {
|
|
934
|
+ org_id, _ := beego.AppConfig.Int64("org_id")
|
|
935
|
+ org_id = 9504
|
|
936
|
+ var orders []*models.HisOrder
|
|
937
|
+ //var orders []*models.HisOrderError
|
|
938
|
+ orders, _ = service.GetAllHisOrder9504()
|
716
|
939
|
for _, item := range orders {
|
717
|
940
|
order_id := item.ID
|
718
|
941
|
order, _ := service.GetHisOrderByIDTwo(order_id)
|
|
@@ -928,6 +1151,227 @@ func GetblBatchSettleList() {
|
928
|
1151
|
}
|
929
|
1152
|
}
|
930
|
1153
|
|
|
1154
|
+func GetlsBatchSettleList() {
|
|
1155
|
+ org_id, _ := beego.AppConfig.Int64("org_id")
|
|
1156
|
+ org_id = 10028
|
|
1157
|
+ var orders []*models.HisOrder
|
|
1158
|
+ //var orders []*models.HisOrderError
|
|
1159
|
+ orders, _ = service.GetAllHisOrder10028()
|
|
1160
|
+ for _, item := range orders {
|
|
1161
|
+ order_id := item.ID
|
|
1162
|
+ order, _ := service.GetHisOrderByIDTwo(order_id)
|
|
1163
|
+ if order.MedType == "14" {
|
|
1164
|
+ his, _ := service.GetHisPatientByNumber(order.MdtrtId)
|
|
1165
|
+ var patientPrescription models.HisPrescriptionInfo
|
|
1166
|
+ patientPrescription, _ = service.FindLastPatientPrescriptionInfo(order.UserOrgId, order.PatientId, order.SettleAccountsDate)
|
|
1167
|
+ doctor_info, _ := service.GetAdminUserInfoByID(order.UserOrgId, patientPrescription.DoctorId)
|
|
1168
|
+ department, _ := service.GetDepartMentDetail(patientPrescription.Departments)
|
|
1169
|
+ miConfig, _ := service.FindMedicalInsuranceInfo(order.UserOrgId)
|
|
1170
|
+ var configTwo []*models.HisXtDiagnoseConfig
|
|
1171
|
+ diagnosis_idstwo := strings.Split(his.Diagnosis, ",")
|
|
1172
|
+ curRoles, _ := service.GetAdminUserInfoByID(org_id, 5320)
|
|
1173
|
+ for _, item := range diagnosis_idstwo {
|
|
1174
|
+ id, _ := strconv.ParseInt(item, 10, 64)
|
|
1175
|
+ diagnosisConfig, _ := service.FindDiagnoseById(id)
|
|
1176
|
+ configTwo = append(configTwo, &diagnosisConfig)
|
|
1177
|
+ }
|
|
1178
|
+ patient, _ := service.GetPatientByIDTwo(10028, order.PatientId)
|
|
1179
|
+
|
|
1180
|
+ sickConfig, _ := service.FindSickById(his.SickType)
|
|
1181
|
+ //if order.MedType == "1111" || order.MedType == "1112" {
|
|
1182
|
+ // order.MedType = "11"
|
|
1183
|
+ //}
|
|
1184
|
+ service.Gdyb2203d(his.PsnNo, his.Number, doctor_info.UserName, department.Name, miConfig.OrgName, "14", doctor_info.DoctorNumber, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.ContentCode, sickConfig.ClassName, curRoles.UserName, configTwo, time.Unix(his.RecordDate, 0).Format("2006-01-02 15:04:05"))
|
|
1185
|
+
|
|
1186
|
+ depart, _ := service.GetDepartMentDetail(curRoles.DepartmentId)
|
|
1187
|
+ pre, _ := service.GetNewHisPrescriptionByNumber(order.Number)
|
|
1188
|
+ doctor, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
|
|
1189
|
+ if order.ID == 0 {
|
|
1190
|
+ return
|
|
1191
|
+ }
|
|
1192
|
+ if his.BalanceAccountsType == 2 {
|
|
1193
|
+ continue
|
|
1194
|
+ }
|
|
1195
|
+
|
|
1196
|
+ ID := strconv.FormatInt(int64(order.ID), 10)
|
|
1197
|
+
|
|
1198
|
+ struct4101 := service.Struct4101{
|
|
1199
|
+ PsnNo: order.PsnNo,
|
|
1200
|
+ MdtrtId: order.MdtrtId,
|
|
1201
|
+ SetlId: order.SetlId,
|
|
1202
|
+ PsnName: order.PsnName,
|
|
1203
|
+ Gend: order.Gend,
|
|
1204
|
+ Brdy: his.Brdy,
|
|
1205
|
+ Age: his.Age,
|
|
1206
|
+ Naty: order.Naty,
|
|
1207
|
+ PatnCertType: order.PsnCertType,
|
|
1208
|
+ Certno: order.Certno,
|
|
1209
|
+ Prfs: "90",
|
|
1210
|
+ ConerName: "",
|
|
1211
|
+ PatnRlts: "",
|
|
1212
|
+ ConerAddr: "",
|
|
1213
|
+ ConerTel: "",
|
|
1214
|
+ HiType: order.Insutype,
|
|
1215
|
+ Insuplc: his.InsuplcAdmdvs,
|
|
1216
|
+ MaindiagFlag: "1",
|
|
1217
|
+ BillCode: "000"+ID,
|
|
1218
|
+ BillNo: "000"+ID,
|
|
1219
|
+ BizSn: order.Number,
|
|
1220
|
+ PsnSelfPay: order.PsnPartAmt,
|
|
1221
|
+ PsnOwnPay: order.PsnPartAmt,
|
|
1222
|
+ AcctPay: order.AcctPay,
|
|
1223
|
+ PsnCashpay: order.PsnCashPay,
|
|
1224
|
+ HiPaymtd: "1",
|
|
1225
|
+ Hsorg: his.InsuplcAdmdvs,
|
|
1226
|
+ HsorgOpter: his.InsuplcAdmdvs,
|
|
1227
|
+ MedinsFillPsn: curRoles.UserName,
|
|
1228
|
+ MedinsFillDept: depart.Name,
|
|
1229
|
+ IptMedType: "2",
|
|
1230
|
+ CurAddr: patient.HomeAddress,
|
|
1231
|
+ }
|
|
1232
|
+
|
|
1233
|
+ struct4101.SetlBegnDate = order.SetlTime
|
|
1234
|
+ struct4101.SetlEndDate = order.SetlTime
|
|
1235
|
+
|
|
1236
|
+ var rf []CustomFundPay
|
|
1237
|
+ json.Unmarshal([]byte(order.SetlDetail), &rf)
|
|
1238
|
+
|
|
1239
|
+ //var tempFunPays []service.CustomStruct
|
|
1240
|
+ //var tempFunPay610100 service.CustomStruct
|
|
1241
|
+
|
|
1242
|
+ //for _, item := range rf {
|
|
1243
|
+ // if item.FundPayType == "610100" {
|
|
1244
|
+ // tempFunPay610100.FundPayamt, _ = decimal.NewFromFloat(tempFunPay610100.FundPayamt).Add(decimal.NewFromFloat(item.FundPayamt)).Float64()
|
|
1245
|
+ // tempFunPay610100.FundPayType = item.FundPayType
|
|
1246
|
+ // } else {
|
|
1247
|
+ // var tempFunPay service.CustomStruct
|
|
1248
|
+ // tempFunPay.FundPayamt = item.FundPayamt
|
|
1249
|
+ // tempFunPay.FundPayType = item.FundPayType
|
|
1250
|
+ // tempFunPays = append(tempFunPays, tempFunPay)
|
|
1251
|
+ // }
|
|
1252
|
+ //}
|
|
1253
|
+ //tempFunPays = append(tempFunPays, tempFunPay610100)
|
|
1254
|
+ //struct4101.CustomStruct = tempFunPays
|
|
1255
|
+
|
|
1256
|
+ var tempDiaginfos []service.DiaginfoStructTwo
|
|
1257
|
+ var tempOpspdiseinfo2 service.OpspdiseinfoStruct
|
|
1258
|
+ var tempOpspdiseinfos []service.OpspdiseinfoStruct
|
|
1259
|
+
|
|
1260
|
+ diagnosis_ids := strings.Split(his.Diagnosis, ",")
|
|
1261
|
+ var config []*models.HisXtDiagnoseConfig
|
|
1262
|
+ for _, item := range diagnosis_ids {
|
|
1263
|
+ id, _ := strconv.ParseInt(item, 10, 64)
|
|
1264
|
+ if id == 24 {
|
|
1265
|
+
|
|
1266
|
+ diagnosisConfig, _ := service.FindDiagnoseById(id)
|
|
1267
|
+ config = append(config, &diagnosisConfig)
|
|
1268
|
+ }
|
|
1269
|
+
|
|
1270
|
+ }
|
|
1271
|
+
|
|
1272
|
+ for _, item := range diagnosis_ids {
|
|
1273
|
+
|
|
1274
|
+ id, _ := strconv.ParseInt(item, 10, 64)
|
|
1275
|
+ if id != 24 {
|
|
1276
|
+ diagnosisConfig, _ := service.FindDiagnoseById(id)
|
|
1277
|
+ config = append(config, &diagnosisConfig)
|
|
1278
|
+ }
|
|
1279
|
+
|
|
1280
|
+ }
|
|
1281
|
+
|
|
1282
|
+ for index, item := range config {
|
|
1283
|
+ if index == 0 {
|
|
1284
|
+ var tempDiaginfo service.DiaginfoStructTwo
|
|
1285
|
+ tempDiaginfo.DiagCode = item.CountryCode
|
|
1286
|
+ tempDiaginfo.DiagName = item.CountryContentName
|
|
1287
|
+ tempDiaginfo.DiagType = "1"
|
|
1288
|
+ tempDiaginfo.MaindiagFlag = "1"
|
|
1289
|
+ tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
|
|
1290
|
+ } else {
|
|
1291
|
+
|
|
1292
|
+ var tempDiaginfo service.DiaginfoStructTwo
|
|
1293
|
+ tempDiaginfo.DiagCode = item.CountryCode
|
|
1294
|
+ tempDiaginfo.DiagName = item.CountryContentName
|
|
1295
|
+ tempDiaginfo.DiagType = "1"
|
|
1296
|
+ tempDiaginfo.MaindiagFlag = "0"
|
|
1297
|
+ tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
|
|
1298
|
+ }
|
|
1299
|
+ }
|
|
1300
|
+ struct4101.Diseinfo = tempDiaginfos
|
|
1301
|
+ sickConfigTwo, _ := service.FindSickById(his.SickType)
|
|
1302
|
+ tempOpspdiseinfo2.DiagCode = sickConfigTwo.ContentCode
|
|
1303
|
+ tempOpspdiseinfo2.DiagName = sickConfigTwo.CountryContentName
|
|
1304
|
+ tempOpspdiseinfo2.OprnOprtCode = ""
|
|
1305
|
+ tempOpspdiseinfo2.OprnOprtName = ""
|
|
1306
|
+ tempOpspdiseinfos = append(tempOpspdiseinfos, tempOpspdiseinfo2)
|
|
1307
|
+ struct4101.OpspdiseinfoStruct = tempOpspdiseinfos
|
|
1308
|
+ time_arr := strings.Split(order.SetlTime, " ")
|
|
1309
|
+ struct4101.AdmTime = time_arr[0]
|
|
1310
|
+ struct4101.AdmEndTime = time_arr[0]
|
|
1311
|
+ struct4101.DoctorName = doctor.UserName
|
|
1312
|
+ struct4101.DoctorCode = doctor.DoctorNumber
|
|
1313
|
+
|
|
1314
|
+ struct4101.Ntly = "CHN"
|
|
1315
|
+ struct4101.AdmCaty = "A03.06"
|
|
1316
|
+ var res ResultSeventeen
|
|
1317
|
+
|
|
1318
|
+ result, request := service.Gdyb4101For10138(struct4101, miConfig.SecretKey, miConfig.OrgName, curRoles.UserName, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, org_id)
|
|
1319
|
+ fmt.Println(result)
|
|
1320
|
+ saveLog(result, request, "4101A", "清单上传")
|
|
1321
|
+ var dat map[string]interface{}
|
|
1322
|
+ if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
|
1323
|
+ fmt.Println(dat)
|
|
1324
|
+ } else {
|
|
1325
|
+ fmt.Println(err)
|
|
1326
|
+ }
|
|
1327
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
1328
|
+ if err := json.Unmarshal(userJSONBytes, &res); err != nil {
|
|
1329
|
+ //utils.ErrorLog("解析失败:%v", err)
|
|
1330
|
+ //c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
1331
|
+ //adminUser := c.GetAdminUserInfo()
|
|
1332
|
+ errlog := &models.HisOrderError{
|
|
1333
|
+ UserOrgId: org_id,
|
|
1334
|
+ Ctime: time.Now().Unix(),
|
|
1335
|
+ Mtime: time.Now().Unix(),
|
|
1336
|
+ ErrMsg: res.ErrMsg + "解析失败",
|
|
1337
|
+ Status: 1,
|
|
1338
|
+ PatientId: order_id,
|
|
1339
|
+ Stage: 10138600,
|
|
1340
|
+ }
|
|
1341
|
+ service.CreateErrMsgLog(errlog)
|
|
1342
|
+ continue
|
|
1343
|
+ }
|
|
1344
|
+
|
|
1345
|
+ if res.Infcode != 0 {
|
|
1346
|
+ //adminUser := c.GetAdminUserInfo()
|
|
1347
|
+ errlog := &models.HisOrderError{
|
|
1348
|
+ UserOrgId: org_id,
|
|
1349
|
+ Ctime: time.Now().Unix(),
|
|
1350
|
+ Mtime: time.Now().Unix(),
|
|
1351
|
+ ErrMsg: res.ErrMsg,
|
|
1352
|
+ Status: 1,
|
|
1353
|
+ PatientId: order_id,
|
|
1354
|
+ Stage: 10138600,
|
|
1355
|
+ }
|
|
1356
|
+ service.CreateErrMsgLog(errlog)
|
|
1357
|
+ continue
|
|
1358
|
+ } else {
|
|
1359
|
+ hisFundSettleListResult := &models.HisFundSettleListResult{
|
|
1360
|
+ Number: res.Output.SetlListId,
|
|
1361
|
+ Status: 1,
|
|
1362
|
+ Ctime: time.Now().Unix(),
|
|
1363
|
+ Mtime: time.Now().Unix(),
|
|
1364
|
+ UserOrgId: org_id,
|
|
1365
|
+ IsUpload: 1,
|
|
1366
|
+ OrderId: order_id,
|
|
1367
|
+ }
|
|
1368
|
+ service.CreateUploadRecord(hisFundSettleListResult)
|
|
1369
|
+ continue
|
|
1370
|
+ }
|
|
1371
|
+ }
|
|
1372
|
+ }
|
|
1373
|
+}
|
|
1374
|
+
|
931
|
1375
|
func GetblpgBatchSettleList() {
|
932
|
1376
|
org_id, _ := beego.AppConfig.Int64("org_id")
|
933
|
1377
|
org_id = 10610
|