|
@@ -705,226 +705,226 @@ type ResultSeventeen struct {
|
705
|
705
|
//}GetAllHisOrder10138
|
706
|
706
|
//
|
707
|
707
|
//
|
708
|
|
-//func GetblBatchSettleList() {
|
709
|
|
-// org_id, _ := beego.AppConfig.Int64("org_id")
|
710
|
|
-// var orders []*models.HisOrder
|
711
|
|
-// //var orders []*models.HisOrderError
|
712
|
|
-// orders, _ = service.GetAllHisOrder10138()
|
713
|
|
-// for _, item := range orders {
|
714
|
|
-// order_id := item.ID
|
715
|
|
-// order, _ := service.GetHisOrderByIDTwo(order_id)
|
716
|
|
-// if order.MedType == "14" {
|
717
|
|
-// his, _ := service.GetHisPatientByNumber(order.MdtrtId)
|
718
|
|
-// var patientPrescription models.HisPrescriptionInfo
|
719
|
|
-// patientPrescription, _ = service.FindLastPatientPrescriptionInfo(order.UserOrgId, order.PatientId, order.SettleAccountsDate)
|
720
|
|
-// doctor_info, _ := service.GetAdminUserInfoByID(order.UserOrgId, patientPrescription.DoctorId)
|
721
|
|
-// department, _ := service.GetDepartMentDetail(patientPrescription.Departments)
|
722
|
|
-// miConfig, _ := service.FindMedicalInsuranceInfo(order.UserOrgId)
|
723
|
|
-// var configTwo []*models.HisXtDiagnoseConfig
|
724
|
|
-// diagnosis_idstwo := strings.Split(his.Diagnosis, ",")
|
725
|
|
-// curRoles, _ := service.GetAdminUserInfoByID(org_id, 5320)
|
726
|
|
-// for _, item := range diagnosis_idstwo {
|
727
|
|
-// id, _ := strconv.ParseInt(item, 10, 64)
|
728
|
|
-// diagnosisConfig, _ := service.FindDiagnoseById(id)
|
729
|
|
-// configTwo = append(configTwo, &diagnosisConfig)
|
730
|
|
-// }
|
731
|
|
-// patient, _ := service.GetPatientByIDTwo(10028, order.PatientId)
|
732
|
|
-//
|
733
|
|
-// sickConfig, _ := service.FindSickById(his.SickType)
|
734
|
|
-// //if order.MedType == "1111" || order.MedType == "1112" {
|
735
|
|
-// // order.MedType = "11"
|
736
|
|
-// //}
|
737
|
|
-// 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"))
|
738
|
|
-//
|
739
|
|
-// depart, _ := service.GetDepartMentDetail(curRoles.DepartmentId)
|
740
|
|
-// pre, _ := service.GetNewHisPrescriptionByNumber(order.Number)
|
741
|
|
-// doctor, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
|
742
|
|
-// if order.ID == 0 {
|
743
|
|
-// return
|
744
|
|
-// }
|
745
|
|
-// if his.BalanceAccountsType == 2 {
|
746
|
|
-// continue
|
747
|
|
-// }
|
748
|
|
-// struct4101 := service.Struct4101{
|
749
|
|
-// PsnNo: order.PsnNo,
|
750
|
|
-// MdtrtId: order.MdtrtId,
|
751
|
|
-// SetlId: order.SetlId,
|
752
|
|
-// PsnName: order.PsnName,
|
753
|
|
-// Gend: order.Gend,
|
754
|
|
-// Brdy: his.Brdy,
|
755
|
|
-// Age: his.Age,
|
756
|
|
-// Naty: order.Naty,
|
757
|
|
-// PatnCertType: order.PsnCertType,
|
758
|
|
-// Certno: order.Certno,
|
759
|
|
-// Prfs: "90",
|
760
|
|
-// ConerName: "",
|
761
|
|
-// PatnRlts: "",
|
762
|
|
-// ConerAddr: "",
|
763
|
|
-// ConerTel: "",
|
764
|
|
-// HiType: order.Insutype,
|
765
|
|
-// Insuplc: his.InsuplcAdmdvs,
|
766
|
|
-// MaindiagFlag: "1",
|
767
|
|
-// BillCode: order.SetlId,
|
768
|
|
-// BillNo: order.SetlId,
|
769
|
|
-// BizSn: order.Number,
|
770
|
|
-// PsnSelfPay: order.PsnPartAmt,
|
771
|
|
-// PsnOwnPay: order.PsnPartAmt,
|
772
|
|
-// AcctPay: order.AcctPay,
|
773
|
|
-// PsnCashpay: order.PsnCashPay,
|
774
|
|
-// HiPaymtd: "1",
|
775
|
|
-// Hsorg: his.InsuplcAdmdvs,
|
776
|
|
-// HsorgOpter: his.InsuplcAdmdvs,
|
777
|
|
-// MedinsFillPsn: curRoles.UserName,
|
778
|
|
-// MedinsFillDept: depart.Name,
|
779
|
|
-// IptMedType: "2",
|
780
|
|
-// CurAddr: patient.HomeAddress,
|
781
|
|
-// }
|
782
|
|
-//
|
783
|
|
-// struct4101.SetlBegnDate = order.SetlTime
|
784
|
|
-// struct4101.SetlEndDate = order.SetlTime
|
785
|
|
-//
|
786
|
|
-// var rf []CustomFundPay
|
787
|
|
-// json.Unmarshal([]byte(order.SetlDetail), &rf)
|
788
|
|
-//
|
789
|
|
-// //var tempFunPays []service.CustomStruct
|
790
|
|
-// //var tempFunPay610100 service.CustomStruct
|
791
|
|
-//
|
792
|
|
-// //for _, item := range rf {
|
793
|
|
-// // if item.FundPayType == "610100" {
|
794
|
|
-// // tempFunPay610100.FundPayamt, _ = decimal.NewFromFloat(tempFunPay610100.FundPayamt).Add(decimal.NewFromFloat(item.FundPayamt)).Float64()
|
795
|
|
-// // tempFunPay610100.FundPayType = item.FundPayType
|
796
|
|
-// // } else {
|
797
|
|
-// // var tempFunPay service.CustomStruct
|
798
|
|
-// // tempFunPay.FundPayamt = item.FundPayamt
|
799
|
|
-// // tempFunPay.FundPayType = item.FundPayType
|
800
|
|
-// // tempFunPays = append(tempFunPays, tempFunPay)
|
801
|
|
-// // }
|
802
|
|
-// //}
|
803
|
|
-// //tempFunPays = append(tempFunPays, tempFunPay610100)
|
804
|
|
-// //struct4101.CustomStruct = tempFunPays
|
805
|
|
-//
|
806
|
|
-// var tempDiaginfos []service.DiaginfoStructTwo
|
807
|
|
-// var tempOpspdiseinfo2 service.OpspdiseinfoStruct
|
808
|
|
-// var tempOpspdiseinfos []service.OpspdiseinfoStruct
|
809
|
|
-//
|
810
|
|
-// diagnosis_ids := strings.Split(his.Diagnosis, ",")
|
811
|
|
-// var config []*models.HisXtDiagnoseConfig
|
812
|
|
-// for _, item := range diagnosis_ids {
|
813
|
|
-// id, _ := strconv.ParseInt(item, 10, 64)
|
814
|
|
-// if id == 24 {
|
815
|
|
-//
|
816
|
|
-// diagnosisConfig, _ := service.FindDiagnoseById(id)
|
817
|
|
-// config = append(config, &diagnosisConfig)
|
818
|
|
-// }
|
819
|
|
-//
|
820
|
|
-// }
|
821
|
|
-//
|
822
|
|
-// for _, item := range diagnosis_ids {
|
823
|
|
-//
|
824
|
|
-// id, _ := strconv.ParseInt(item, 10, 64)
|
825
|
|
-// if id != 24 {
|
826
|
|
-// diagnosisConfig, _ := service.FindDiagnoseById(id)
|
827
|
|
-// config = append(config, &diagnosisConfig)
|
828
|
|
-// }
|
829
|
|
-//
|
830
|
|
-// }
|
831
|
|
-//
|
832
|
|
-// for index, item := range config {
|
833
|
|
-// if index == 0 {
|
834
|
|
-// var tempDiaginfo service.DiaginfoStructTwo
|
835
|
|
-// tempDiaginfo.DiagCode = item.CountryCode
|
836
|
|
-// tempDiaginfo.DiagName = item.CountryContentName
|
837
|
|
-// tempDiaginfo.DiagType = "1"
|
838
|
|
-// tempDiaginfo.MaindiagFlag = "1"
|
839
|
|
-// tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
|
840
|
|
-// } else {
|
841
|
|
-//
|
842
|
|
-// var tempDiaginfo service.DiaginfoStructTwo
|
843
|
|
-// tempDiaginfo.DiagCode = item.CountryCode
|
844
|
|
-// tempDiaginfo.DiagName = item.CountryContentName
|
845
|
|
-// tempDiaginfo.DiagType = "1"
|
846
|
|
-// tempDiaginfo.MaindiagFlag = "0"
|
847
|
|
-// tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
|
848
|
|
-// }
|
849
|
|
-// }
|
850
|
|
-// struct4101.Diseinfo = tempDiaginfos
|
851
|
|
-// sickConfigTwo, _ := service.FindSickById(his.SickType)
|
852
|
|
-// tempOpspdiseinfo2.DiagCode = sickConfigTwo.ContentCode
|
853
|
|
-// tempOpspdiseinfo2.DiagName = sickConfigTwo.CountryContentName
|
854
|
|
-// tempOpspdiseinfo2.OprnOprtCode = ""
|
855
|
|
-// tempOpspdiseinfo2.OprnOprtName = ""
|
856
|
|
-// tempOpspdiseinfos = append(tempOpspdiseinfos, tempOpspdiseinfo2)
|
857
|
|
-// struct4101.OpspdiseinfoStruct = tempOpspdiseinfos
|
858
|
|
-// time_arr := strings.Split(order.SetlTime, " ")
|
859
|
|
-// struct4101.AdmTime = time_arr[0]
|
860
|
|
-// struct4101.AdmEndTime = time_arr[0]
|
861
|
|
-// struct4101.DoctorName = doctor.UserName
|
862
|
|
-// struct4101.DoctorCode = doctor.DoctorNumber
|
863
|
|
-//
|
864
|
|
-// struct4101.Ntly = "CHN"
|
865
|
|
-// struct4101.AdmCaty = "A03.06"
|
866
|
|
-// var res ResultSeventeen
|
867
|
|
-//
|
868
|
|
-// result, request := service.Gdyb4101For10138(struct4101, miConfig.SecretKey, miConfig.OrgName, curRoles.UserName, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, org_id)
|
869
|
|
-// fmt.Println(result)
|
870
|
|
-// saveLog(result, request, "4101A", "清单上传")
|
871
|
|
-// var dat map[string]interface{}
|
872
|
|
-// if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
873
|
|
-// fmt.Println(dat)
|
874
|
|
-// } else {
|
875
|
|
-// fmt.Println(err)
|
876
|
|
-// }
|
877
|
|
-// userJSONBytes, _ := json.Marshal(dat)
|
878
|
|
-// if err := json.Unmarshal(userJSONBytes, &res); err != nil {
|
879
|
|
-// //utils.ErrorLog("解析失败:%v", err)
|
880
|
|
-// //c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
881
|
|
-// //adminUser := c.GetAdminUserInfo()
|
882
|
|
-// errlog := &models.HisOrderError{
|
883
|
|
-// UserOrgId: org_id,
|
884
|
|
-// Ctime: time.Now().Unix(),
|
885
|
|
-// Mtime: time.Now().Unix(),
|
886
|
|
-// ErrMsg: res.ErrMsg + "解析失败",
|
887
|
|
-// Status: 1,
|
888
|
|
-// PatientId: order_id,
|
889
|
|
-// Stage: 10138600,
|
890
|
|
-// }
|
891
|
|
-// service.CreateErrMsgLog(errlog)
|
892
|
|
-// continue
|
893
|
|
-// }
|
894
|
|
-//
|
895
|
|
-// if res.Infcode != 0 {
|
896
|
|
-// //adminUser := c.GetAdminUserInfo()
|
897
|
|
-// errlog := &models.HisOrderError{
|
898
|
|
-// UserOrgId: org_id,
|
899
|
|
-// Ctime: time.Now().Unix(),
|
900
|
|
-// Mtime: time.Now().Unix(),
|
901
|
|
-// ErrMsg: res.ErrMsg,
|
902
|
|
-// Status: 1,
|
903
|
|
-// PatientId: order_id,
|
904
|
|
-// Stage: 10138600,
|
905
|
|
-// }
|
906
|
|
-// service.CreateErrMsgLog(errlog)
|
907
|
|
-// continue
|
908
|
|
-// } else {
|
909
|
|
-// hisFundSettleListResult := &models.HisFundSettleListResult{
|
910
|
|
-// Number: res.Output.SetlListId,
|
911
|
|
-// Status: 1,
|
912
|
|
-// Ctime: time.Now().Unix(),
|
913
|
|
-// Mtime: time.Now().Unix(),
|
914
|
|
-// UserOrgId: org_id,
|
915
|
|
-// IsUpload: 1,
|
916
|
|
-// OrderId: order_id,
|
917
|
|
-// }
|
918
|
|
-// service.CreateUploadRecord(hisFundSettleListResult)
|
919
|
|
-// continue
|
920
|
|
-// }
|
921
|
|
-// }
|
922
|
|
-// }
|
923
|
|
-//}
|
|
708
|
+func GetblBatchSettleList() {
|
|
709
|
+ org_id, _ := beego.AppConfig.Int64("org_id")
|
|
710
|
+ var orders []*models.HisOrder
|
|
711
|
+ //var orders []*models.HisOrderError
|
|
712
|
+ orders, _ = service.GetAllHisOrder10138()
|
|
713
|
+ for _, item := range orders {
|
|
714
|
+ order_id := item.ID
|
|
715
|
+ order, _ := service.GetHisOrderByIDTwo(order_id)
|
|
716
|
+ if order.MedType == "14" {
|
|
717
|
+ his, _ := service.GetHisPatientByNumber(order.MdtrtId)
|
|
718
|
+ var patientPrescription models.HisPrescriptionInfo
|
|
719
|
+ patientPrescription, _ = service.FindLastPatientPrescriptionInfo(order.UserOrgId, order.PatientId, order.SettleAccountsDate)
|
|
720
|
+ doctor_info, _ := service.GetAdminUserInfoByID(order.UserOrgId, patientPrescription.DoctorId)
|
|
721
|
+ department, _ := service.GetDepartMentDetail(patientPrescription.Departments)
|
|
722
|
+ miConfig, _ := service.FindMedicalInsuranceInfo(order.UserOrgId)
|
|
723
|
+ var configTwo []*models.HisXtDiagnoseConfig
|
|
724
|
+ diagnosis_idstwo := strings.Split(his.Diagnosis, ",")
|
|
725
|
+ curRoles, _ := service.GetAdminUserInfoByID(org_id, 5318)
|
|
726
|
+ for _, item := range diagnosis_idstwo {
|
|
727
|
+ id, _ := strconv.ParseInt(item, 10, 64)
|
|
728
|
+ diagnosisConfig, _ := service.FindDiagnoseById(id)
|
|
729
|
+ configTwo = append(configTwo, &diagnosisConfig)
|
|
730
|
+ }
|
|
731
|
+ patient, _ := service.GetPatientByIDTwo(10138, order.PatientId)
|
|
732
|
+
|
|
733
|
+ sickConfig, _ := service.FindSickById(his.SickType)
|
|
734
|
+ //if order.MedType == "1111" || order.MedType == "1112" {
|
|
735
|
+ // order.MedType = "11"
|
|
736
|
+ //}
|
|
737
|
+ 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"))
|
|
738
|
+
|
|
739
|
+ depart, _ := service.GetDepartMentDetail(curRoles.DepartmentId)
|
|
740
|
+ pre, _ := service.GetNewHisPrescriptionByNumber(order.Number)
|
|
741
|
+ doctor, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
|
|
742
|
+ if order.ID == 0 {
|
|
743
|
+ return
|
|
744
|
+ }
|
|
745
|
+ if his.BalanceAccountsType == 2 {
|
|
746
|
+ continue
|
|
747
|
+ }
|
|
748
|
+ struct4101 := service.Struct4101{
|
|
749
|
+ PsnNo: order.PsnNo,
|
|
750
|
+ MdtrtId: order.MdtrtId,
|
|
751
|
+ SetlId: order.SetlId,
|
|
752
|
+ PsnName: order.PsnName,
|
|
753
|
+ Gend: order.Gend,
|
|
754
|
+ Brdy: his.Brdy,
|
|
755
|
+ Age: his.Age,
|
|
756
|
+ Naty: order.Naty,
|
|
757
|
+ PatnCertType: order.PsnCertType,
|
|
758
|
+ Certno: order.Certno,
|
|
759
|
+ Prfs: "90",
|
|
760
|
+ ConerName: "",
|
|
761
|
+ PatnRlts: "",
|
|
762
|
+ ConerAddr: "",
|
|
763
|
+ ConerTel: "",
|
|
764
|
+ HiType: order.Insutype,
|
|
765
|
+ Insuplc: his.InsuplcAdmdvs,
|
|
766
|
+ MaindiagFlag: "1",
|
|
767
|
+ BillCode: order.SetlId,
|
|
768
|
+ BillNo: order.SetlId,
|
|
769
|
+ BizSn: order.Number,
|
|
770
|
+ PsnSelfPay: order.PsnPartAmt,
|
|
771
|
+ PsnOwnPay: order.PsnPartAmt,
|
|
772
|
+ AcctPay: order.AcctPay,
|
|
773
|
+ PsnCashpay: order.PsnCashPay,
|
|
774
|
+ HiPaymtd: "1",
|
|
775
|
+ Hsorg: his.InsuplcAdmdvs,
|
|
776
|
+ HsorgOpter: his.InsuplcAdmdvs,
|
|
777
|
+ MedinsFillPsn: curRoles.UserName,
|
|
778
|
+ MedinsFillDept: depart.Name,
|
|
779
|
+ IptMedType: "2",
|
|
780
|
+ CurAddr: patient.HomeAddress,
|
|
781
|
+ }
|
|
782
|
+
|
|
783
|
+ struct4101.SetlBegnDate = order.SetlTime
|
|
784
|
+ struct4101.SetlEndDate = order.SetlTime
|
|
785
|
+
|
|
786
|
+ var rf []CustomFundPay
|
|
787
|
+ json.Unmarshal([]byte(order.SetlDetail), &rf)
|
|
788
|
+
|
|
789
|
+ //var tempFunPays []service.CustomStruct
|
|
790
|
+ //var tempFunPay610100 service.CustomStruct
|
|
791
|
+
|
|
792
|
+ //for _, item := range rf {
|
|
793
|
+ // if item.FundPayType == "610100" {
|
|
794
|
+ // tempFunPay610100.FundPayamt, _ = decimal.NewFromFloat(tempFunPay610100.FundPayamt).Add(decimal.NewFromFloat(item.FundPayamt)).Float64()
|
|
795
|
+ // tempFunPay610100.FundPayType = item.FundPayType
|
|
796
|
+ // } else {
|
|
797
|
+ // var tempFunPay service.CustomStruct
|
|
798
|
+ // tempFunPay.FundPayamt = item.FundPayamt
|
|
799
|
+ // tempFunPay.FundPayType = item.FundPayType
|
|
800
|
+ // tempFunPays = append(tempFunPays, tempFunPay)
|
|
801
|
+ // }
|
|
802
|
+ //}
|
|
803
|
+ //tempFunPays = append(tempFunPays, tempFunPay610100)
|
|
804
|
+ //struct4101.CustomStruct = tempFunPays
|
|
805
|
+
|
|
806
|
+ var tempDiaginfos []service.DiaginfoStructTwo
|
|
807
|
+ var tempOpspdiseinfo2 service.OpspdiseinfoStruct
|
|
808
|
+ var tempOpspdiseinfos []service.OpspdiseinfoStruct
|
|
809
|
+
|
|
810
|
+ diagnosis_ids := strings.Split(his.Diagnosis, ",")
|
|
811
|
+ var config []*models.HisXtDiagnoseConfig
|
|
812
|
+ for _, item := range diagnosis_ids {
|
|
813
|
+ id, _ := strconv.ParseInt(item, 10, 64)
|
|
814
|
+ if id == 24 {
|
|
815
|
+
|
|
816
|
+ diagnosisConfig, _ := service.FindDiagnoseById(id)
|
|
817
|
+ config = append(config, &diagnosisConfig)
|
|
818
|
+ }
|
|
819
|
+
|
|
820
|
+ }
|
|
821
|
+
|
|
822
|
+ for _, item := range diagnosis_ids {
|
|
823
|
+
|
|
824
|
+ id, _ := strconv.ParseInt(item, 10, 64)
|
|
825
|
+ if id != 24 {
|
|
826
|
+ diagnosisConfig, _ := service.FindDiagnoseById(id)
|
|
827
|
+ config = append(config, &diagnosisConfig)
|
|
828
|
+ }
|
|
829
|
+
|
|
830
|
+ }
|
|
831
|
+
|
|
832
|
+ for index, item := range config {
|
|
833
|
+ if index == 0 {
|
|
834
|
+ var tempDiaginfo service.DiaginfoStructTwo
|
|
835
|
+ tempDiaginfo.DiagCode = item.CountryCode
|
|
836
|
+ tempDiaginfo.DiagName = item.CountryContentName
|
|
837
|
+ tempDiaginfo.DiagType = "1"
|
|
838
|
+ tempDiaginfo.MaindiagFlag = "1"
|
|
839
|
+ tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
|
|
840
|
+ } else {
|
|
841
|
+
|
|
842
|
+ var tempDiaginfo service.DiaginfoStructTwo
|
|
843
|
+ tempDiaginfo.DiagCode = item.CountryCode
|
|
844
|
+ tempDiaginfo.DiagName = item.CountryContentName
|
|
845
|
+ tempDiaginfo.DiagType = "1"
|
|
846
|
+ tempDiaginfo.MaindiagFlag = "0"
|
|
847
|
+ tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
|
|
848
|
+ }
|
|
849
|
+ }
|
|
850
|
+ struct4101.Diseinfo = tempDiaginfos
|
|
851
|
+ sickConfigTwo, _ := service.FindSickById(his.SickType)
|
|
852
|
+ tempOpspdiseinfo2.DiagCode = sickConfigTwo.ContentCode
|
|
853
|
+ tempOpspdiseinfo2.DiagName = sickConfigTwo.CountryContentName
|
|
854
|
+ tempOpspdiseinfo2.OprnOprtCode = ""
|
|
855
|
+ tempOpspdiseinfo2.OprnOprtName = ""
|
|
856
|
+ tempOpspdiseinfos = append(tempOpspdiseinfos, tempOpspdiseinfo2)
|
|
857
|
+ struct4101.OpspdiseinfoStruct = tempOpspdiseinfos
|
|
858
|
+ time_arr := strings.Split(order.SetlTime, " ")
|
|
859
|
+ struct4101.AdmTime = time_arr[0]
|
|
860
|
+ struct4101.AdmEndTime = time_arr[0]
|
|
861
|
+ struct4101.DoctorName = doctor.UserName
|
|
862
|
+ struct4101.DoctorCode = doctor.DoctorNumber
|
|
863
|
+
|
|
864
|
+ struct4101.Ntly = "CHN"
|
|
865
|
+ struct4101.AdmCaty = "A03.06"
|
|
866
|
+ var res ResultSeventeen
|
|
867
|
+
|
|
868
|
+ result, request := service.Gdyb4101For10138(struct4101, miConfig.SecretKey, miConfig.OrgName, curRoles.UserName, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, org_id)
|
|
869
|
+ fmt.Println(result)
|
|
870
|
+ saveLog(result, request, "4101A", "清单上传")
|
|
871
|
+ var dat map[string]interface{}
|
|
872
|
+ if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
|
873
|
+ fmt.Println(dat)
|
|
874
|
+ } else {
|
|
875
|
+ fmt.Println(err)
|
|
876
|
+ }
|
|
877
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
878
|
+ if err := json.Unmarshal(userJSONBytes, &res); err != nil {
|
|
879
|
+ //utils.ErrorLog("解析失败:%v", err)
|
|
880
|
+ //c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
881
|
+ //adminUser := c.GetAdminUserInfo()
|
|
882
|
+ errlog := &models.HisOrderError{
|
|
883
|
+ UserOrgId: org_id,
|
|
884
|
+ Ctime: time.Now().Unix(),
|
|
885
|
+ Mtime: time.Now().Unix(),
|
|
886
|
+ ErrMsg: res.ErrMsg + "解析失败",
|
|
887
|
+ Status: 1,
|
|
888
|
+ PatientId: order_id,
|
|
889
|
+ Stage: 10138600,
|
|
890
|
+ }
|
|
891
|
+ service.CreateErrMsgLog(errlog)
|
|
892
|
+ continue
|
|
893
|
+ }
|
|
894
|
+
|
|
895
|
+ if res.Infcode != 0 {
|
|
896
|
+ //adminUser := c.GetAdminUserInfo()
|
|
897
|
+ errlog := &models.HisOrderError{
|
|
898
|
+ UserOrgId: org_id,
|
|
899
|
+ Ctime: time.Now().Unix(),
|
|
900
|
+ Mtime: time.Now().Unix(),
|
|
901
|
+ ErrMsg: res.ErrMsg,
|
|
902
|
+ Status: 1,
|
|
903
|
+ PatientId: order_id,
|
|
904
|
+ Stage: 10138600,
|
|
905
|
+ }
|
|
906
|
+ service.CreateErrMsgLog(errlog)
|
|
907
|
+ continue
|
|
908
|
+ } else {
|
|
909
|
+ hisFundSettleListResult := &models.HisFundSettleListResult{
|
|
910
|
+ Number: res.Output.SetlListId,
|
|
911
|
+ Status: 1,
|
|
912
|
+ Ctime: time.Now().Unix(),
|
|
913
|
+ Mtime: time.Now().Unix(),
|
|
914
|
+ UserOrgId: org_id,
|
|
915
|
+ IsUpload: 1,
|
|
916
|
+ OrderId: order_id,
|
|
917
|
+ }
|
|
918
|
+ service.CreateUploadRecord(hisFundSettleListResult)
|
|
919
|
+ continue
|
|
920
|
+ }
|
|
921
|
+ }
|
|
922
|
+ }
|
|
923
|
+}
|
924
|
924
|
|
925
|
925
|
func GetblbrBatchSettleList() {
|
926
|
926
|
org_id, _ := beego.AppConfig.Int64("org_id")
|
927
|
|
- org_id = 10537
|
|
927
|
+ org_id = 10278
|
928
|
928
|
var orders []*models.HisOrder
|
929
|
929
|
//var orders []*models.HisOrderError
|
930
|
930
|
orders, _ = service.GetAllHisOrder10278()
|
|
@@ -940,13 +940,13 @@ func GetblbrBatchSettleList() {
|
940
|
940
|
miConfig, _ := service.FindMedicalInsuranceInfo(order.UserOrgId)
|
941
|
941
|
var configTwo []*models.HisXtDiagnoseConfig
|
942
|
942
|
diagnosis_idstwo := strings.Split(his.Diagnosis, ",")
|
943
|
|
- curRoles, _ := service.GetAdminUserInfoByID(org_id, 2234)
|
|
943
|
+ curRoles, _ := service.GetAdminUserInfoByID(org_id, 2791)
|
944
|
944
|
for _, item := range diagnosis_idstwo {
|
945
|
945
|
id, _ := strconv.ParseInt(item, 10, 64)
|
946
|
946
|
diagnosisConfig, _ := service.FindDiagnoseById(id)
|
947
|
947
|
configTwo = append(configTwo, &diagnosisConfig)
|
948
|
948
|
}
|
949
|
|
- patient, _ := service.GetPatientByIDTwo(10537, order.PatientId)
|
|
949
|
+ patient, _ := service.GetPatientByIDTwo(10278, order.PatientId)
|
950
|
950
|
|
951
|
951
|
//sickConfig, _ := service.FindSickById(his.SickType)
|
952
|
952
|
//if order.MedType == "1111" || order.MedType == "1112" {
|