|
@@ -14,10 +14,7 @@ import (
|
14
|
14
|
"math/rand"
|
15
|
15
|
"net/http"
|
16
|
16
|
"strconv"
|
17
|
|
- "strings"
|
18
|
|
- "syscall"
|
19
|
17
|
"time"
|
20
|
|
- "unsafe"
|
21
|
18
|
)
|
22
|
19
|
|
23
|
20
|
type SZHisApiController struct {
|
|
@@ -26,11 +23,11 @@ type SZHisApiController struct {
|
26
|
23
|
|
27
|
24
|
func SZHisManagerApiRegistRouters() {
|
28
|
25
|
|
29
|
|
- beego.Router("/sz/api/card/get", &SZHisApiController{}, "get:GetCardInfo")
|
|
26
|
+ //beego.Router("/sz/api/card/get", &SZHisApiController{}, "get:GetCardInfo")
|
30
|
27
|
beego.Router("/sz/api/register/get", &SZHisApiController{}, "get:GetRegisterInfo")
|
31
|
28
|
beego.Router("/sz/api/upload/get", &SZHisApiController{}, "get:GetUploadInfo")
|
32
|
29
|
beego.Router("/sz/api/settle/get", &SZHisApiController{}, "get:GetSettleInfo")
|
33
|
|
- beego.Router("/sz/api/settle/query", &SZHisApiController{}, "get:GetSettleAccounts")
|
|
30
|
+ //beego.Router("/sz/api/settle/query", &SZHisApiController{}, "get:GetSettleAccounts")
|
34
|
31
|
|
35
|
32
|
}
|
36
|
33
|
|
|
@@ -618,9 +615,11 @@ type Custom struct {
|
618
|
615
|
|
619
|
616
|
//获取读卡信息 -- 门诊挂号
|
620
|
617
|
func (c *SZHisApiController) GetRegisterInfo() {
|
621
|
|
- adminInfo := c.GetAdminUserInfo()
|
622
|
|
- admin_user_id, _ := c.GetInt64("admin_user_id")
|
623
|
|
- adminRole, _ := service.GetAdminUserInfoByID(adminInfo.CurrentOrgId, admin_user_id)
|
|
618
|
+ //adminInfo := c.GetAdminUserInfo()
|
|
619
|
+ //admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
620
|
+ //adminRole, _ := service.GetAdminUserInfoByID(adminInfo.CurrentOrgId, admin_user_id)
|
|
621
|
+ resp_result := service.SzybMZ002("黄亦轩", "1001", "G5540", "013", "%GAAFSAKSXSUKKWDKHDAD?;07734724145330238292?", "000000|e14f1d0ad6acdf00ce4d6b9f69d877b6")
|
|
622
|
+ fmt.Println(resp_result)
|
624
|
623
|
|
625
|
624
|
//month := time.Unix(1557042972, 0).Format("1")
|
626
|
625
|
//year := time.Now().Format("2006")
|
|
@@ -629,36 +628,36 @@ func (c *SZHisApiController) GetRegisterInfo() {
|
629
|
628
|
|
630
|
629
|
//1.读卡 获取交易验证码,医疗证号,发卡地区行政区划代码
|
631
|
630
|
//miConfig, _ := service.FindMedicalInsuranceInfo(adminInfo.CurrentOrgId)
|
632
|
|
- DllDef2 := syscall.MustLoadDLL("SSSE32.dll")
|
633
|
|
- readCards := DllDef2.MustFindProc("iReadCardBas")
|
634
|
|
- str := "MZ002|H1110201801031000001|G5540"
|
635
|
|
- str3 := make([]byte, 256)
|
636
|
|
- ret4, _, err4 := readCards.Call(StrPtr(str), (uintptr)(unsafe.Pointer(&str3[0])))
|
637
|
|
- fmt.Println(":", string(str3))
|
638
|
|
-
|
639
|
|
- if err4 != nil {
|
640
|
|
- fmt.Println("SSCard的运算结果为:", ret4)
|
641
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
|
642
|
|
- return
|
643
|
|
- }
|
644
|
|
-
|
645
|
|
- if ret4 == 0 {
|
646
|
|
- result := string(str3)
|
647
|
|
- fmt.Println(result)
|
648
|
|
- result_arr := strings.Split(result, "|")
|
649
|
|
- //医疗证号
|
650
|
|
- number := result_arr[12]
|
651
|
|
- //VerifyCode
|
652
|
|
- verifyCode := result_arr[11] + "|" + result_arr[13]
|
653
|
|
-
|
654
|
|
- //挂号
|
655
|
|
- resp_result := service.SzybMZ002(adminRole.UserName, strconv.FormatInt(adminRole.ID, 10), "G5540", "013", number, verifyCode)
|
656
|
|
- fmt.Println(resp_result)
|
657
|
|
-
|
658
|
|
- } else {
|
659
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
|
660
|
|
- return
|
661
|
|
- }
|
|
631
|
+ //DllDef2 := syscall.MustLoadDLL("SSSE32.dll")
|
|
632
|
+ //readCards := DllDef2.MustFindProc("iReadCardBas")
|
|
633
|
+ //str := "MZ002|H1110201801031000001|G5540"
|
|
634
|
+ //str3 := make([]byte, 256)
|
|
635
|
+ //ret4, _, err4 := readCards.Call(StrPtr(str), (uintptr)(unsafe.Pointer(&str3[0])))
|
|
636
|
+ //fmt.Println(":", string(str3))
|
|
637
|
+ //
|
|
638
|
+ //if err4 != nil {
|
|
639
|
+ // fmt.Println("SSCard的运算结果为:", ret4)
|
|
640
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
|
|
641
|
+ // return
|
|
642
|
+ //}
|
|
643
|
+ //
|
|
644
|
+ //if ret4 == 0 {
|
|
645
|
+ // result := string(str3)
|
|
646
|
+ // fmt.Println(result)
|
|
647
|
+ // result_arr := strings.Split(result, "|")
|
|
648
|
+ // //医疗证号
|
|
649
|
+ // number := result_arr[12]
|
|
650
|
+ // //VerifyCode
|
|
651
|
+ // verifyCode := result_arr[11] + "|" + result_arr[13]
|
|
652
|
+ //
|
|
653
|
+ // //挂号
|
|
654
|
+ // resp_result := service.SzybMZ002(adminRole.UserName, strconv.FormatInt(adminRole.ID, 10), "G5540", "013", number, verifyCode)
|
|
655
|
+ // fmt.Println(resp_result)
|
|
656
|
+ //
|
|
657
|
+ //} else {
|
|
658
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
|
|
659
|
+ // return
|
|
660
|
+ //}
|
662
|
661
|
|
663
|
662
|
//id, _ := c.GetInt64("id")
|
664
|
663
|
//record_time := c.GetString("record_time")
|
|
@@ -735,8 +734,8 @@ func (c *SZHisApiController) GetRegisterInfo() {
|
735
|
734
|
|
736
|
735
|
//上传明细----预结算----确认订单
|
737
|
736
|
func (c *SZHisApiController) GetUploadInfo() {
|
738
|
|
- id, _ := c.GetInt64("id")
|
739
|
|
- record_time := c.GetString("record_time")
|
|
737
|
+ //id, _ := c.GetInt64("id")
|
|
738
|
+ //record_time := c.GetString("record_time")
|
740
|
739
|
//pay_way, _ := c.GetInt64("pay_way")
|
741
|
740
|
//pay_price, _ := c.GetFloat("pay_price")
|
742
|
741
|
//pay_card_no := c.GetString("pay_card_no")
|
|
@@ -746,61 +745,61 @@ func (c *SZHisApiController) GetUploadInfo() {
|
746
|
745
|
//found_price, _ := c.GetFloat("found_price")
|
747
|
746
|
//medical_insurance_price, _ := c.GetFloat("medical_insurance_price")
|
748
|
747
|
//private_price, _ := c.GetFloat("private_price")
|
749
|
|
- settle_accounts_type, _ := c.GetInt64("settle_accounts_type")
|
750
|
|
- admin_user_id, _ := c.GetInt64("admin_user_id")
|
751
|
|
-
|
752
|
|
- timeLayout := "2006-01-02"
|
753
|
|
- loc, _ := time.LoadLocation("Local")
|
754
|
|
- theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_time+" 00:00:00", loc)
|
755
|
|
- if err != nil {
|
756
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
757
|
|
- return
|
758
|
|
- }
|
759
|
|
- recordDateTime := theTime.Unix()
|
760
|
|
- adminUser := c.GetAdminUserInfo()
|
|
748
|
+ //settle_accounts_type, _ := c.GetInt64("settle_accounts_type")
|
|
749
|
+ //admin_user_id, _ := c.GetInt64("admin_user_id")
|
761
|
750
|
|
|
751
|
+ //timeLayout := "2006-01-02"
|
|
752
|
+ //loc, _ := time.LoadLocation("Local")
|
|
753
|
+ //theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_time+" 00:00:00", loc)
|
|
754
|
+ //if err != nil {
|
|
755
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
756
|
+ // return
|
|
757
|
+ //}
|
|
758
|
+ //recordDateTime := theTime.Unix()
|
|
759
|
+ //adminUser := c.GetAdminUserInfo()
|
762
|
760
|
//
|
763
|
|
- var prescriptions []*models.HisPrescription
|
|
761
|
+ ////
|
|
762
|
+ //var prescriptions []*models.HisPrescription
|
|
763
|
+ ////
|
764
|
764
|
//
|
765
|
|
-
|
766
|
|
- data := make(map[string]interface{})
|
767
|
|
- if settle_accounts_type == 1 { //日结
|
768
|
|
- prescriptions, _ = service.GetHisPrescription(adminUser.CurrentOrgId, id, recordDateTime)
|
769
|
|
- data["pre"] = prescriptions
|
770
|
|
-
|
771
|
|
- } else { //月结
|
772
|
|
- start_time_str := c.GetString("start_time")
|
773
|
|
- end_time_str := c.GetString("end_time")
|
774
|
|
- timeLayout := "2006-01-02"
|
775
|
|
- loc, _ := time.LoadLocation("Local")
|
776
|
|
- theStartTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time_str+" 00:00:00", loc)
|
777
|
|
- if err != nil {
|
778
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
779
|
|
- return
|
780
|
|
- }
|
781
|
|
- recordStartTime := theStartTime.Unix()
|
782
|
|
- theEndTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time_str+" 00:00:00", loc)
|
783
|
|
- if err != nil {
|
784
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
785
|
|
- return
|
786
|
|
- }
|
787
|
|
- recordEndTime := theEndTime.Unix()
|
788
|
|
- prescriptions, _ = service.GetMonthHisPrescription(adminUser.CurrentOrgId, id, recordStartTime, recordEndTime)
|
789
|
|
- data["pre"] = prescriptions
|
790
|
|
-
|
791
|
|
- }
|
792
|
|
-
|
793
|
|
- roles, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
|
794
|
|
- his, _ := service.GetVMHisPatientInfo(adminUser.CurrentOrgId, id, recordDateTime)
|
|
765
|
+ //data := make(map[string]interface{})
|
|
766
|
+ //if settle_accounts_type == 1 { //日结
|
|
767
|
+ // prescriptions, _ = service.GetHisPrescription(adminUser.CurrentOrgId, id, recordDateTime)
|
|
768
|
+ // data["pre"] = prescriptions
|
|
769
|
+ //
|
|
770
|
+ //} else { //月结
|
|
771
|
+ // start_time_str := c.GetString("start_time")
|
|
772
|
+ // end_time_str := c.GetString("end_time")
|
|
773
|
+ // timeLayout := "2006-01-02"
|
|
774
|
+ // loc, _ := time.LoadLocation("Local")
|
|
775
|
+ // theStartTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time_str+" 00:00:00", loc)
|
|
776
|
+ // if err != nil {
|
|
777
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
778
|
+ // return
|
|
779
|
+ // }
|
|
780
|
+ // recordStartTime := theStartTime.Unix()
|
|
781
|
+ // theEndTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time_str+" 00:00:00", loc)
|
|
782
|
+ // if err != nil {
|
|
783
|
+ // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
784
|
+ // return
|
|
785
|
+ // }
|
|
786
|
+ // recordEndTime := theEndTime.Unix()
|
|
787
|
+ // prescriptions, _ = service.GetMonthHisPrescription(adminUser.CurrentOrgId, id, recordStartTime, recordEndTime)
|
|
788
|
+ // data["pre"] = prescriptions
|
|
789
|
+ //
|
|
790
|
+ //}
|
|
791
|
+ //
|
|
792
|
+ //roles, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
|
|
793
|
+ //his, _ := service.GetVMHisPatientInfo(adminUser.CurrentOrgId, id, recordDateTime)
|
795
|
794
|
timestamp := time.Now().Unix()
|
796
|
795
|
tempTime := time.Unix(timestamp, 0)
|
797
|
796
|
timeFormat := tempTime.Format("20060102150405")
|
798
|
|
- chrgBchno := rand.Intn(100000) + 10000
|
799
|
|
- chrg_bchno := timeFormat + strconv.FormatInt(int64(chrgBchno), 10) + strconv.FormatInt(his.PatientId, 10)
|
|
797
|
+ chrgBchno := rand.Intn(10000) + 1000
|
|
798
|
+ chrg_bchno := timeFormat + strconv.FormatInt(int64(chrgBchno), 10) + strconv.FormatInt(1, 10)
|
800
|
799
|
//miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
|
801
|
800
|
//patientPrescription, _ := service.FindPatientPrescriptionInfo(adminUser.CurrentOrgId, id, recordDateTime)
|
802
|
801
|
//department, _ := service.GetDepartMentDetail(patientPrescription.Departments)
|
803
|
|
- strconv.FormatInt(his.PatientId, 10)
|
|
802
|
+ //strconv.FormatInt(his.PatientId, 10)
|
804
|
803
|
|
805
|
804
|
month := time.Unix(1557042972, 0).Format("1")
|
806
|
805
|
year := time.Now().Format("2006")
|
|
@@ -808,84 +807,100 @@ func (c *SZHisApiController) GetUploadInfo() {
|
808
|
807
|
day := time.Now().Format("02")
|
809
|
808
|
|
810
|
809
|
var customs []*models.CustomDetail
|
811
|
|
-
|
812
|
|
- for _, item := range prescriptions {
|
813
|
|
- if item.Type == 1 { //药品
|
814
|
|
- for _, subItem := range item.HisDoctorAdviceInfo {
|
815
|
|
- if len(subItem.BaseDrugLib.MedicalInsuranceNumber) > 0 {
|
816
|
|
- //var randNum int
|
817
|
|
- //randNum = rand.Intn(10000) + 1000
|
818
|
|
- detItemFeeSumamt, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", subItem.Price*subItem.PrescribingNumber), 64)
|
819
|
|
- price, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", subItem.Price), 64)
|
820
|
|
- cus := &models.CustomDetail{
|
821
|
|
- PrescriptionNumber: chrg_bchno,
|
822
|
|
- OrderType: "1",
|
823
|
|
- ChargeSerialNumber: subItem.FeedetlSn,
|
824
|
|
- Code: subItem.BaseDrugLib.MedicalInsuranceNumber,
|
825
|
|
- CodeName: subItem.BaseDrugLib.DrugName,
|
826
|
|
- Flag: "1",
|
827
|
|
- Price: price,
|
828
|
|
- Count: subItem.PrescribingNumber,
|
829
|
|
- ChargeOrderDate: year + month + day,
|
830
|
|
- DoctorCode: "H24962918",
|
831
|
|
- Total: detItemFeeSumamt,
|
832
|
|
- }
|
833
|
|
- customs = append(customs, cus)
|
834
|
|
- }
|
835
|
|
- }
|
836
|
|
- }
|
837
|
|
-
|
838
|
|
- if item.Type == 2 { //项目
|
839
|
|
- for _, subItem := range item.HisPrescriptionProject {
|
840
|
|
- //var randNum int
|
841
|
|
- //randNum = rand.Intn(10000) + 1000
|
842
|
|
- if len(subItem.HisProject.MedicalCode) > 0 {
|
843
|
|
- detItemFeeSumamt, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", subItem.Price*float64(subItem.Count)), 64)
|
844
|
|
-
|
845
|
|
- count, _ := strconv.ParseFloat(fmt.Sprintf("%f", subItem.Count), 64)
|
846
|
|
-
|
847
|
|
- cus := &models.CustomDetail{
|
848
|
|
-
|
849
|
|
- PrescriptionNumber: chrg_bchno,
|
850
|
|
- OrderType: "1",
|
851
|
|
- ChargeSerialNumber: subItem.FeedetlSn,
|
852
|
|
- Code: subItem.HisProject.MedicalCode,
|
853
|
|
- CodeName: subItem.HisProject.ProjectName,
|
854
|
|
- Flag: "1",
|
855
|
|
- Price: subItem.Price,
|
856
|
|
- Count: count,
|
857
|
|
- ChargeOrderDate: year + month + day,
|
858
|
|
- DoctorCode: "H24962918",
|
859
|
|
- Total: detItemFeeSumamt,
|
860
|
|
- }
|
861
|
|
- customs = append(customs, cus)
|
862
|
|
- }
|
863
|
|
- }
|
864
|
|
- }
|
865
|
|
-
|
866
|
|
- for _, subItem := range item.HisAdditionalCharge {
|
867
|
|
- if len(subItem.XtHisAddtionConfig.Code) > 0 {
|
868
|
|
- detItemFeeSumamt, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", subItem.Price*float64(subItem.Count)), 64)
|
869
|
|
-
|
870
|
|
- count, _ := strconv.ParseFloat(fmt.Sprintf("%f", subItem.Count), 64)
|
871
|
|
- cus := &models.CustomDetail{
|
872
|
|
- PrescriptionNumber: chrg_bchno,
|
873
|
|
- OrderType: "1",
|
874
|
|
- ChargeSerialNumber: subItem.FeedetlSn,
|
875
|
|
- Code: subItem.XtHisAddtionConfig.Code,
|
876
|
|
- CodeName: subItem.XtHisAddtionConfig.Name,
|
877
|
|
- Flag: "1",
|
878
|
|
- Price: subItem.Price,
|
879
|
|
- Count: count,
|
880
|
|
- ChargeOrderDate: year + month + day,
|
881
|
|
- DoctorCode: "H24962918",
|
882
|
|
- Total: detItemFeeSumamt,
|
883
|
|
- }
|
884
|
|
- customs = append(customs, cus)
|
885
|
|
- }
|
|
810
|
+ for i := 0; i < 1; i++ {
|
|
811
|
+ cus := &models.CustomDetail{
|
|
812
|
+ PrescriptionNumber: chrg_bchno,
|
|
813
|
+ OrderType: "1",
|
|
814
|
+ ChargeSerialNumber: strconv.FormatInt(int64(rand.Intn(100000)+10000), 10),
|
|
815
|
+ Code: "86901187000367",
|
|
816
|
+ CodeName: "普瑞巴林胶囊剂",
|
|
817
|
+ Flag: "1",
|
|
818
|
+ Price: 12.50,
|
|
819
|
+ Count: 1,
|
|
820
|
+ ChargeOrderDate: year + month + day,
|
|
821
|
+ DoctorCode: "H24962918",
|
|
822
|
+ Total: 12.50,
|
886
|
823
|
}
|
|
824
|
+ customs = append(customs, cus)
|
887
|
825
|
}
|
888
|
826
|
|
|
827
|
+ //for _, item := range prescriptions {
|
|
828
|
+ // if item.Type == 1 { //药品
|
|
829
|
+ // for _, subItem := range item.HisDoctorAdviceInfo {
|
|
830
|
+ // if len(subItem.BaseDrugLib.MedicalInsuranceNumber) > 0 {
|
|
831
|
+ // //var randNum int
|
|
832
|
+ // //randNum = rand.Intn(10000) + 1000
|
|
833
|
+ // detItemFeeSumamt, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", subItem.Price*subItem.PrescribingNumber), 64)
|
|
834
|
+ // price, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", subItem.Price), 64)
|
|
835
|
+ // cus := &models.CustomDetail{
|
|
836
|
+ // PrescriptionNumber: chrg_bchno,
|
|
837
|
+ // OrderType: "1",
|
|
838
|
+ // ChargeSerialNumber: subItem.FeedetlSn,
|
|
839
|
+ // Code: subItem.BaseDrugLib.MedicalInsuranceNumber,
|
|
840
|
+ // CodeName: subItem.BaseDrugLib.DrugName,
|
|
841
|
+ // Flag: "1",
|
|
842
|
+ // Price: price,
|
|
843
|
+ // Count: subItem.PrescribingNumber,
|
|
844
|
+ // ChargeOrderDate: year + month + day,
|
|
845
|
+ // DoctorCode: "H24962918",
|
|
846
|
+ // Total: detItemFeeSumamt,
|
|
847
|
+ // }
|
|
848
|
+ // customs = append(customs, cus)
|
|
849
|
+ // }
|
|
850
|
+ // }
|
|
851
|
+ // }
|
|
852
|
+ //
|
|
853
|
+ // if item.Type == 2 { //项目
|
|
854
|
+ // for _, subItem := range item.HisPrescriptionProject {
|
|
855
|
+ // //var randNum int
|
|
856
|
+ // //randNum = rand.Intn(10000) + 1000
|
|
857
|
+ // if len(subItem.HisProject.MedicalCode) > 0 {
|
|
858
|
+ // detItemFeeSumamt, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", subItem.Price*float64(subItem.Count)), 64)
|
|
859
|
+ //
|
|
860
|
+ // count, _ := strconv.ParseFloat(fmt.Sprintf("%f", subItem.Count), 64)
|
|
861
|
+ //
|
|
862
|
+ // cus := &models.CustomDetail{
|
|
863
|
+ //
|
|
864
|
+ // PrescriptionNumber: chrg_bchno,
|
|
865
|
+ // OrderType: "1",
|
|
866
|
+ // ChargeSerialNumber: subItem.FeedetlSn,
|
|
867
|
+ // Code: subItem.HisProject.MedicalCode,
|
|
868
|
+ // CodeName: subItem.HisProject.ProjectName,
|
|
869
|
+ // Flag: "1",
|
|
870
|
+ // Price: subItem.Price,
|
|
871
|
+ // Count: count,
|
|
872
|
+ // ChargeOrderDate: year + month + day,
|
|
873
|
+ // DoctorCode: "H24962918",
|
|
874
|
+ // Total: detItemFeeSumamt,
|
|
875
|
+ // }
|
|
876
|
+ // customs = append(customs, cus)
|
|
877
|
+ // }
|
|
878
|
+ // }
|
|
879
|
+ // }
|
|
880
|
+ //
|
|
881
|
+ // for _, subItem := range item.HisAdditionalCharge {
|
|
882
|
+ // if len(subItem.XtHisAddtionConfig.Code) > 0 {
|
|
883
|
+ // detItemFeeSumamt, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", subItem.Price*float64(subItem.Count)), 64)
|
|
884
|
+ //
|
|
885
|
+ // count, _ := strconv.ParseFloat(fmt.Sprintf("%f", subItem.Count), 64)
|
|
886
|
+ // cus := &models.CustomDetail{
|
|
887
|
+ // PrescriptionNumber: chrg_bchno,
|
|
888
|
+ // OrderType: "1",
|
|
889
|
+ // ChargeSerialNumber: subItem.FeedetlSn,
|
|
890
|
+ // Code: subItem.XtHisAddtionConfig.Code,
|
|
891
|
+ // CodeName: subItem.XtHisAddtionConfig.Name,
|
|
892
|
+ // Flag: "1",
|
|
893
|
+ // Price: subItem.Price,
|
|
894
|
+ // Count: count,
|
|
895
|
+ // ChargeOrderDate: year + month + day,
|
|
896
|
+ // DoctorCode: "H24962918",
|
|
897
|
+ // Total: detItemFeeSumamt,
|
|
898
|
+ // }
|
|
899
|
+ // customs = append(customs, cus)
|
|
900
|
+ // }
|
|
901
|
+ // }
|
|
902
|
+ //}
|
|
903
|
+
|
889
|
904
|
//分页处理
|
890
|
905
|
//ToLimitOffset(50,1,len())
|
891
|
906
|
//pages := 50 / len(customs)
|
|
@@ -910,36 +925,36 @@ func (c *SZHisApiController) GetUploadInfo() {
|
910
|
925
|
//这里就可以查看开始和结束了
|
911
|
926
|
fmt.Println(customs[start-1 : stop])
|
912
|
927
|
|
913
|
|
- result := service.SzybFY001(roles.UserName, strconv.FormatInt(roles.ID, 10), "G5540", customs, "000000|da09d0aac76bcf6552be41356ddbbaec")
|
914
|
|
- fmt.Println(curpage)
|
915
|
|
- fmt.Println(":")
|
916
|
|
- fmt.Println(result)
|
917
|
|
- }
|
918
|
|
-
|
919
|
|
- var total float64
|
920
|
|
- for _, item := range prescriptions {
|
921
|
|
- if item.Type == 1 { //药品
|
922
|
|
- for _, subItem := range item.HisDoctorAdviceInfo {
|
923
|
|
- total = total + (subItem.Price * subItem.PrescribingNumber)
|
924
|
|
- }
|
925
|
|
- }
|
926
|
|
- if item.Type == 2 { //项目
|
927
|
|
- for _, subItem := range item.HisPrescriptionProject {
|
928
|
|
- total = total + (subItem.Price * float64(subItem.Count))
|
929
|
|
- }
|
930
|
|
- }
|
|
928
|
+ //result := service.SzybFY001("黄亦轩", "1001", "G5540", customs, "000000|c0ccb063d7b0846b0945590520ae1668")
|
|
929
|
+ //fmt.Println("result")
|
|
930
|
+ //fmt.Println(":")
|
|
931
|
+ //fmt.Println(result)
|
931
|
932
|
}
|
932
|
933
|
|
933
|
|
- for _, item := range prescriptions {
|
934
|
|
- for _, subItem := range item.HisAdditionalCharge {
|
935
|
|
- total = total + (subItem.Price * float64(subItem.Count))
|
936
|
|
- }
|
937
|
|
- }
|
938
|
|
- totals, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", total), 64)
|
939
|
|
- result := service.SzybFY004(roles.UserName, strconv.FormatInt(roles.ID, 10), "G5540", "", totals, chrg_bchno, "000000|da09d0aac76bcf6552be41356ddbbaec")
|
|
934
|
+ //var total float64
|
|
935
|
+ //for _, item := range prescriptions {
|
|
936
|
+ // if item.Type == 1 { //药品
|
|
937
|
+ // for _, subItem := range item.HisDoctorAdviceInfo {
|
|
938
|
+ // total = total + (subItem.Price * subItem.PrescribingNumber)
|
|
939
|
+ // }
|
|
940
|
+ // }
|
|
941
|
+ // if item.Type == 2 { //项目
|
|
942
|
+ // for _, subItem := range item.HisPrescriptionProject {
|
|
943
|
+ // total = total + (subItem.Price * float64(subItem.Count))
|
|
944
|
+ // }
|
|
945
|
+ // }
|
|
946
|
+ //}
|
|
947
|
+ //
|
|
948
|
+ //for _, item := range prescriptions {
|
|
949
|
+ // for _, subItem := range item.HisAdditionalCharge {
|
|
950
|
+ // total = total + (subItem.Price * float64(subItem.Count))
|
|
951
|
+ // }
|
|
952
|
+ //}
|
|
953
|
+ //totals, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", total), 64)
|
|
954
|
+ result := service.SzybFY004("黄亦轩", "H24962918", "G5540", "", 12.50, chrg_bchno, "000000|abacf56c397f74c0fb603ee09b4f61fb")
|
940
|
955
|
fmt.Println(result)
|
941
|
|
-
|
942
|
|
- results := service.SzybFY005(roles.UserName, strconv.FormatInt(roles.ID, 10), "G5540", "", totals, chrg_bchno, "000000|da09d0aac76bcf6552be41356ddbbaec")
|
|
956
|
+ //
|
|
957
|
+ results := service.SzybFY005("黄亦轩", "H24962918", "G5540", "", 12.50, chrg_bchno, "000000|abacf56c397f74c0fb603ee09b4f61fb")
|
943
|
958
|
fmt.Println(results)
|
944
|
959
|
|
945
|
960
|
//client := &http.Client{}
|