|
@@ -685,7 +685,7 @@ func (c *HisApiController) GetUploadInfo() {
|
685
|
685
|
medical_insurance_price, _ := c.GetFloat("medical_insurance_price")
|
686
|
686
|
private_price, _ := c.GetFloat("private_price")
|
687
|
687
|
|
688
|
|
- //settle_accounts_type, _ := c.GetInt64("settle_accounts_type")
|
|
688
|
+ settle_accounts_type, _ := c.GetInt64("settle_accounts_type")
|
689
|
689
|
|
690
|
690
|
timeLayout := "2006-01-02"
|
691
|
691
|
loc, _ := time.LoadLocation("Local")
|
|
@@ -698,106 +698,104 @@ func (c *HisApiController) GetUploadInfo() {
|
698
|
698
|
adminUser := c.GetAdminUserInfo()
|
699
|
699
|
|
700
|
700
|
var prescriptions []*models.HisPrescription
|
701
|
|
- prescriptions, _ = service.GetHisPrescription(adminUser.CurrentOrgId, id, recordDateTime)
|
702
|
701
|
|
703
|
|
- //if settle_accounts_type == 1 { //日结
|
704
|
|
- //
|
705
|
|
- //} else
|
706
|
|
- //{ //月结
|
707
|
|
- // start_time := c.GetString("start_time")
|
708
|
|
- // end_time := c.GetString("end_time")
|
709
|
|
- // timeLayout := "2006-01-02"
|
710
|
|
- // loc, _ := time.LoadLocation("Local")
|
711
|
|
- // theStartTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
712
|
|
- // if err != nil {
|
713
|
|
- // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
714
|
|
- // return
|
715
|
|
- // }
|
716
|
|
- // recordStartTime := theStartTime.Unix()
|
717
|
|
- // theEndTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 00:00:00", loc)
|
718
|
|
- // if err != nil {
|
719
|
|
- // c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
720
|
|
- // return
|
721
|
|
- // }
|
722
|
|
- // recordEndTime := theEndTime.Unix()
|
723
|
|
- // monthPrescriptions, _ := service.GetMonthHisPrescription(adminUser.CurrentOrgId, id, recordStartTime, recordEndTime)
|
724
|
|
- // var advices []*models.HisDoctorAdviceInfo
|
725
|
|
- // var projects []*models.HisPrescriptionProject
|
726
|
|
- // var additions []*models.HisAdditionalCharge
|
727
|
|
- // var customs []*models.Custom
|
728
|
|
- // for _, item := range monthPrescriptions {
|
729
|
|
- // advices = append(advices, item.HisDoctorAdviceInfo...)
|
730
|
|
- // projects = append(projects, item.HisPrescriptionProject...)
|
731
|
|
- // additions = append(additions, item.HisAdditionalCharge...)
|
732
|
|
- // }
|
733
|
|
- //
|
734
|
|
- // var adviceCodes []string
|
735
|
|
- // var projectCodes []string
|
736
|
|
- // var additionCodes []string
|
737
|
|
- //
|
738
|
|
- //
|
739
|
|
- //
|
740
|
|
- //
|
741
|
|
- // for _, item := range advices {
|
742
|
|
- // adviceCodes = append(adviceCodes, item.MedListCodg)
|
743
|
|
- // }
|
744
|
|
- // for _, item := range projects {
|
745
|
|
- // projectCodes = append(projectCodes, item.MedListCodg)
|
746
|
|
- // }
|
747
|
|
- // for _, item := range additions {
|
748
|
|
- // additionCodes = append(additionCodes, item.XtHisAddtionConfig.Code)
|
749
|
|
- // }
|
750
|
|
- // adviceCodes = RemoveRepeatedCode(adviceCodes)
|
751
|
|
- // projectCodes = RemoveRepeatedCode(projectCodes)
|
752
|
|
- // additionCodes = RemoveRepeatedCode(additionCodes)
|
753
|
|
- //
|
754
|
|
- // for _, item := range adviceCodes{
|
755
|
|
- // var custom models.Custom
|
756
|
|
- // for _,subItem := range advices{
|
757
|
|
- // if item == subItem.MedListCodg{
|
758
|
|
- // custom.Price =fmt.Sprintf("%.2f", subItem.Price)
|
759
|
|
- // custom.MedListCodg = subItem.MedListCodg
|
760
|
|
- // custom.Cut = fmt.Sprintf("%.2f", subItem.PrescribingNumber)
|
761
|
|
- // custom.DetItemFeeSumamt = fmt.Sprintf("%.2f", subItem.Price*subItem.PrescribingNumber)
|
762
|
|
- // custom.FeedetlSn = subItem.FeedetlSn
|
763
|
|
- // customs = append(customs,&custom)
|
764
|
|
- // }
|
765
|
|
- // }
|
766
|
|
- // }
|
767
|
|
- //
|
768
|
|
- //
|
769
|
|
- // for _, item := range additionCodes{
|
770
|
|
- // var custom models.Custom
|
771
|
|
- // for _,subItem := range additions{
|
772
|
|
- // if item == subItem.XtHisAddtionConfig.Code{
|
773
|
|
- // custom.Price =fmt.Sprintf("%.2f", subItem.Price)
|
774
|
|
- // custom.MedListCodg = subItem.XtHisAddtionConfig.Code
|
775
|
|
- // custom.Cut = fmt.Sprintf("%.2f", subItem.Count)
|
776
|
|
- // custom.DetItemFeeSumamt = fmt.Sprintf("%.2f", subItem.Price*float64(subItem.Count))
|
777
|
|
- // custom.FeedetlSn = subItem.FeedetlSn
|
778
|
|
- // customs = append(customs,&custom)
|
779
|
|
- // }
|
780
|
|
- // }
|
781
|
|
- // }
|
782
|
|
- //
|
783
|
|
- // for _, item := range projectCodes{
|
784
|
|
- // var custom models.Custom
|
785
|
|
- // for _,subItem := range projects{
|
786
|
|
- // if item == subItem.MedListCodg{
|
787
|
|
- // custom.Price =fmt.Sprintf("%.2f", subItem.Price)
|
788
|
|
- // custom.MedListCodg = subItem.MedListCodg
|
789
|
|
- // custom.Cut = fmt.Sprintf("%.2f", subItem.Count)
|
790
|
|
- // custom.DetItemFeeSumamt = fmt.Sprintf("%.2f", subItem.Price*float64(subItem.Count))
|
791
|
|
- // custom.FeedetlSn = subItem.FeedetlSn
|
792
|
|
- // customs = append(customs,&custom)
|
793
|
|
- // }
|
794
|
|
- // }
|
795
|
|
- // }
|
796
|
|
- //
|
797
|
|
- //}
|
|
702
|
+ data := make(map[string]interface{})
|
|
703
|
+ if settle_accounts_type == 1 { //日结
|
|
704
|
+ prescriptions, _ = service.GetHisPrescription(adminUser.CurrentOrgId, id, recordDateTime)
|
|
705
|
+ data["pre"] = prescriptions
|
|
706
|
+
|
|
707
|
+ } else { //月结
|
|
708
|
+ start_time := c.GetString("start_time")
|
|
709
|
+ end_time := c.GetString("end_time")
|
|
710
|
+ timeLayout := "2006-01-02"
|
|
711
|
+ loc, _ := time.LoadLocation("Local")
|
|
712
|
+ theStartTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
|
713
|
+ if err != nil {
|
|
714
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
715
|
+ return
|
|
716
|
+ }
|
|
717
|
+ recordStartTime := theStartTime.Unix()
|
|
718
|
+ theEndTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 00:00:00", loc)
|
|
719
|
+ if err != nil {
|
|
720
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
721
|
+ return
|
|
722
|
+ }
|
|
723
|
+ recordEndTime := theEndTime.Unix()
|
|
724
|
+ prescriptions, _ = service.GetMonthHisPrescription(adminUser.CurrentOrgId, id, recordStartTime, recordEndTime)
|
|
725
|
+ data["pre"] = prescriptions
|
|
726
|
+
|
|
727
|
+ //var advices []*models.HisDoctorAdviceInfo
|
|
728
|
+ //var projects []*models.HisPrescriptionProject
|
|
729
|
+ //var additions []*models.HisAdditionalCharge
|
|
730
|
+ //var customs []*models.Custom
|
|
731
|
+ //for _, item := range monthPrescriptions {
|
|
732
|
+ // advices = append(advices, item.HisDoctorAdviceInfo...)
|
|
733
|
+ // projects = append(projects, item.HisPrescriptionProject...)
|
|
734
|
+ // additions = append(additions, item.HisAdditionalCharge...)
|
|
735
|
+ //}
|
|
736
|
+ //
|
|
737
|
+ //var adviceCodes []string
|
|
738
|
+ //var projectCodes []string
|
|
739
|
+ //var additionCodes []string
|
|
740
|
+ //
|
|
741
|
+ //
|
|
742
|
+ //
|
|
743
|
+ //
|
|
744
|
+ //for _, item := range advices {
|
|
745
|
+ // adviceCodes = append(adviceCodes, item.MedListCodg)
|
|
746
|
+ //}
|
|
747
|
+ //for _, item := range projects {
|
|
748
|
+ // projectCodes = append(projectCodes, item.MedListCodg)
|
|
749
|
+ //}
|
|
750
|
+ //for _, item := range additions {
|
|
751
|
+ // additionCodes = append(additionCodes, item.XtHisAddtionConfig.Code)
|
|
752
|
+ //}
|
|
753
|
+ //adviceCodes = RemoveRepeatedCode(adviceCodes)
|
|
754
|
+ //projectCodes = RemoveRepeatedCode(projectCodes)
|
|
755
|
+ //additionCodes = RemoveRepeatedCode(additionCodes)
|
|
756
|
+ //
|
|
757
|
+ //for _, item := range adviceCodes{
|
|
758
|
+ // var custom models.Custom
|
|
759
|
+ // for _,subItem := range advices{
|
|
760
|
+ // if item == subItem.MedListCodg{
|
|
761
|
+ // custom.Price =fmt.Sprintf("%.2f", subItem.Price)
|
|
762
|
+ // custom.MedListCodg = subItem.MedListCodg
|
|
763
|
+ // custom.Cut = fmt.Sprintf("%.2f", subItem.PrescribingNumber)
|
|
764
|
+ // custom.DetItemFeeSumamt = fmt.Sprintf("%.2f", subItem.Price*subItem.PrescribingNumber)
|
|
765
|
+ // custom.FeedetlSn = subItem.FeedetlSn
|
|
766
|
+ // customs = append(customs,&custom)
|
|
767
|
+ // }
|
|
768
|
+ // }
|
|
769
|
+ //}
|
|
770
|
+ //for _, item := range additionCodes{
|
|
771
|
+ // var custom models.Custom
|
|
772
|
+ // for _,subItem := range additions{
|
|
773
|
+ // if item == subItem.XtHisAddtionConfig.Code{
|
|
774
|
+ // custom.Price =fmt.Sprintf("%.2f", subItem.Price)
|
|
775
|
+ // custom.MedListCodg = subItem.XtHisAddtionConfig.Code
|
|
776
|
+ // custom.Cut = fmt.Sprintf("%.2f", subItem.Count)
|
|
777
|
+ // custom.DetItemFeeSumamt = fmt.Sprintf("%.2f", subItem.Price*float64(subItem.Count))
|
|
778
|
+ // custom.FeedetlSn = subItem.FeedetlSn
|
|
779
|
+ // customs = append(customs,&custom)
|
|
780
|
+ // }
|
|
781
|
+ // }
|
|
782
|
+ //}
|
|
783
|
+ //for _, item := range projectCodes{
|
|
784
|
+ // var custom models.Custom
|
|
785
|
+ // for _,subItem := range projects{
|
|
786
|
+ // if item == subItem.MedListCodg{
|
|
787
|
+ // custom.Price =fmt.Sprintf("%.2f", subItem.Price)
|
|
788
|
+ // custom.MedListCodg = subItem.MedListCodg
|
|
789
|
+ // custom.Cut = fmt.Sprintf("%.2f", subItem.Count)
|
|
790
|
+ // custom.DetItemFeeSumamt = fmt.Sprintf("%.2f", subItem.Price*float64(subItem.Count))
|
|
791
|
+ // custom.FeedetlSn = subItem.FeedetlSn
|
|
792
|
+ // customs = append(customs,&custom)
|
|
793
|
+ // }
|
|
794
|
+ // }
|
|
795
|
+ //}
|
798
|
796
|
|
|
797
|
+ }
|
799
|
798
|
his, _ := service.GetVMHisPatientInfo(adminUser.CurrentOrgId, id, recordDateTime)
|
800
|
|
-
|
801
|
799
|
timestamp := time.Now().Unix()
|
802
|
800
|
tempTime := time.Unix(timestamp, 0)
|
803
|
801
|
timeFormat := tempTime.Format("20060102150405")
|
|
@@ -808,10 +806,8 @@ func (c *HisApiController) GetUploadInfo() {
|
808
|
806
|
department, _ := service.GetDepartMentDetail(patientPrescription.Departments)
|
809
|
807
|
strconv.FormatInt(his.PatientId, 10)
|
810
|
808
|
client := &http.Client{}
|
811
|
|
- data := make(map[string]interface{})
|
812
|
809
|
data["psn_no"] = his.PsnNo
|
813
|
810
|
data["mdtrt_id"] = his.Number
|
814
|
|
- data["pre"] = prescriptions
|
815
|
811
|
data["chrg_bchno"] = chrg_bchno
|
816
|
812
|
data["org_name"] = miConfig.OrgName
|
817
|
813
|
data["doctor"] = patientPrescription.Doctor
|