|
@@ -2,6 +2,10 @@ package sz
|
2
|
2
|
|
3
|
3
|
import (
|
4
|
4
|
"gdyb/controllers"
|
|
5
|
+ "gdyb/enums"
|
|
6
|
+ "gdyb/service"
|
|
7
|
+ "github.com/astaxie/beego"
|
|
8
|
+ "time"
|
5
|
9
|
)
|
6
|
10
|
|
7
|
11
|
type SZHisApiController struct {
|
|
@@ -9,10 +13,12 @@ type SZHisApiController struct {
|
9
|
13
|
}
|
10
|
14
|
|
11
|
15
|
func SZHisManagerApiRegistRouters() {
|
12
|
|
- //beego.Router("/sz/api/register/get", &SZHisApiController{}, "get:GetRegisterInfo")
|
13
|
|
- //beego.Router("/sz/api/upload/get", &SZHisApiController{}, "get:GetUploadInfo")
|
14
|
|
- //beego.Router("/sz/api/settle/get", &SZHisApiController{}, "get:GetSettleInfo")
|
15
|
|
- //beego.Router("/sz/api/settle/query", &SZHisApiController{}, "get:GetSettleAccounts")
|
|
16
|
+
|
|
17
|
+ beego.Router("/sz/api/card/get", &SZHisApiController{}, "get:GetCardInfo")
|
|
18
|
+ beego.Router("/sz/api/register/get", &SZHisApiController{}, "get:GetRegisterInfo")
|
|
19
|
+ beego.Router("/sz/api/upload/get", &SZHisApiController{}, "get:GetUploadInfo")
|
|
20
|
+ beego.Router("/sz/api/settle/get", &SZHisApiController{}, "get:GetSettleInfo")
|
|
21
|
+ beego.Router("/sz/api/settle/query", &SZHisApiController{}, "get:GetSettleAccounts")
|
16
|
22
|
|
17
|
23
|
}
|
18
|
24
|
|
|
@@ -599,81 +605,80 @@ type Custom struct {
|
599
|
605
|
}
|
600
|
606
|
|
601
|
607
|
//获取个人信息----挂号-----上传就诊信息
|
602
|
|
-//func (c *SZHisApiController) GetRegisterInfo() {
|
603
|
|
-// id, _ := c.GetInt64("id")
|
604
|
|
-// record_time := c.GetString("record_time")
|
605
|
|
-// settlementValue, _ := c.GetInt64("settlement_value")
|
606
|
|
-// medical_insurance_card := c.GetString("medical_insurance_card")
|
607
|
|
-// name := c.GetString("name")
|
608
|
|
-// id_card_type, _ := c.GetInt64("id_card_type")
|
609
|
|
-// certificates, _ := c.GetInt64("certificates")
|
610
|
|
-// medical_care, _ := c.GetInt64("medical_care")
|
611
|
|
-// birthday := c.GetString("birthday")
|
612
|
|
-// age, _ := c.GetInt64("age")
|
613
|
|
-// id_card := c.GetString("id_card")
|
614
|
|
-// register_type, _ := c.GetInt64("register")
|
615
|
|
-// doctor, _ := c.GetInt64("doctor")
|
616
|
|
-// department, _ := c.GetInt64("department")
|
617
|
|
-// gender, _ := c.GetInt64("sex")
|
618
|
|
-// phone := c.GetString("phone")
|
619
|
|
-// registration_fee, _ := c.GetFloat("registration_fee")
|
620
|
|
-// medical_expenses, _ := c.GetFloat("medical_expenses")
|
621
|
|
-// social_type, _ := c.GetInt64("social_type")
|
622
|
|
-// admin_user_id, _ := c.GetInt64("admin_user_id")
|
623
|
|
-//
|
624
|
|
-// diagnosis_id, _ := c.GetInt64("diagnosis")
|
625
|
|
-// sick_type, _ := c.GetInt64("sick_type")
|
626
|
|
-// reg_type := c.GetString("p_type")
|
627
|
|
-//
|
628
|
|
-// timeLayout := "2006-01-02"
|
629
|
|
-// loc, _ := time.LoadLocation("Local")
|
630
|
|
-// birthdays, _ := time.ParseInLocation(timeLayout+" 15:04:05", birthday+" 00:00:00", loc)
|
631
|
|
-// birthUnix := birthdays.Unix()
|
632
|
|
-//
|
633
|
|
-// theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_time+" 00:00:00", loc)
|
634
|
|
-// if err != nil {
|
635
|
|
-// c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
636
|
|
-// return
|
637
|
|
-// }
|
638
|
|
-// recordDateTime := theTime.Unix()
|
639
|
|
-//
|
640
|
|
-// adminInfo := c.GetAdminUserInfo()
|
641
|
|
-// var patient service.Patients
|
642
|
|
-// if id == 0 {
|
643
|
|
-// patient, _ = service.GetPatientByIDCard(id_card, adminInfo.CurrentOrgId)
|
644
|
|
-// } else {
|
645
|
|
-// patient, _ = service.GetPatientByIDTwo(adminInfo.CurrentOrgId, id)
|
646
|
|
-// }
|
647
|
|
-//
|
648
|
|
-// patientPrescription, _ := service.FindPatientPrescriptionInfo(adminInfo.CurrentOrgId, id, recordDateTime)
|
649
|
|
-// if patientPrescription.ID == 0 {
|
650
|
|
-// patientPrescription, _ = service.FindLastPatientPrescriptionInfo(adminInfo.CurrentOrgId, id, recordDateTime)
|
651
|
|
-// }
|
652
|
|
-//
|
653
|
|
-// //adminRole, _ := service.GetAdminUserInfoByID(adminInfo.CurrentOrgId, adminInfo.AdminUser.Id)
|
654
|
|
-//
|
655
|
|
-// //diagnosisConfig, _ := service.FindDiagnoseById(diagnosis_id)
|
656
|
|
-// //sickConfig, _ := service.FindSickById(sick_type)
|
657
|
|
-// //miConfig, _ := service.FindMedicalInsuranceInfo(adminInfo.CurrentOrgId)
|
658
|
|
-// if patient.ID == 0 {
|
659
|
|
-// c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodePatientNoExist)
|
660
|
|
-// return
|
661
|
|
-// }
|
662
|
|
-// if len(patient.IdCardNo) == 0 {
|
663
|
|
-// c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeIDCartNo)
|
664
|
|
-// return
|
665
|
|
-// }
|
666
|
|
-// config, _ := service.GetMedicalInsuranceConfig(adminInfo.CurrentOrgId)
|
667
|
|
-//
|
668
|
|
-// if config.IsOpen == 1 {
|
669
|
|
-//
|
670
|
|
-//
|
671
|
|
-//
|
672
|
|
-// c.ServeSuccessJSON(map[string]interface{}{
|
673
|
|
-// "his_info": hisPatient,
|
674
|
|
-// })
|
675
|
|
-// }
|
676
|
|
-//}
|
|
608
|
+func (c *SZHisApiController) GetRegisterInfo() {
|
|
609
|
+ id, _ := c.GetInt64("id")
|
|
610
|
+ record_time := c.GetString("record_time")
|
|
611
|
+ settlementValue, _ := c.GetInt64("settlement_value")
|
|
612
|
+ medical_insurance_card := c.GetString("medical_insurance_card")
|
|
613
|
+ name := c.GetString("name")
|
|
614
|
+ id_card_type, _ := c.GetInt64("id_card_type")
|
|
615
|
+ certificates, _ := c.GetInt64("certificates")
|
|
616
|
+ medical_care, _ := c.GetInt64("medical_care")
|
|
617
|
+ birthday := c.GetString("birthday")
|
|
618
|
+ age, _ := c.GetInt64("age")
|
|
619
|
+ id_card := c.GetString("id_card")
|
|
620
|
+ register_type, _ := c.GetInt64("register")
|
|
621
|
+ doctor, _ := c.GetInt64("doctor")
|
|
622
|
+ department, _ := c.GetInt64("department")
|
|
623
|
+ gender, _ := c.GetInt64("sex")
|
|
624
|
+ phone := c.GetString("phone")
|
|
625
|
+ registration_fee, _ := c.GetFloat("registration_fee")
|
|
626
|
+ medical_expenses, _ := c.GetFloat("medical_expenses")
|
|
627
|
+ social_type, _ := c.GetInt64("social_type")
|
|
628
|
+ admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
629
|
+
|
|
630
|
+ diagnosis_id, _ := c.GetInt64("diagnosis")
|
|
631
|
+ sick_type, _ := c.GetInt64("sick_type")
|
|
632
|
+ reg_type := c.GetString("p_type")
|
|
633
|
+
|
|
634
|
+ timeLayout := "2006-01-02"
|
|
635
|
+ loc, _ := time.LoadLocation("Local")
|
|
636
|
+ birthdays, _ := time.ParseInLocation(timeLayout+" 15:04:05", birthday+" 00:00:00", loc)
|
|
637
|
+ birthUnix := birthdays.Unix()
|
|
638
|
+
|
|
639
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_time+" 00:00:00", loc)
|
|
640
|
+ if err != nil {
|
|
641
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
642
|
+ return
|
|
643
|
+ }
|
|
644
|
+ recordDateTime := theTime.Unix()
|
|
645
|
+
|
|
646
|
+ adminInfo := c.GetAdminUserInfo()
|
|
647
|
+ var patient service.Patients
|
|
648
|
+ if id == 0 {
|
|
649
|
+ patient, _ = service.GetPatientByIDCard(id_card, adminInfo.CurrentOrgId)
|
|
650
|
+ } else {
|
|
651
|
+ patient, _ = service.GetPatientByIDTwo(adminInfo.CurrentOrgId, id)
|
|
652
|
+ }
|
|
653
|
+
|
|
654
|
+ patientPrescription, _ := service.FindPatientPrescriptionInfo(adminInfo.CurrentOrgId, id, recordDateTime)
|
|
655
|
+ if patientPrescription.ID == 0 {
|
|
656
|
+ patientPrescription, _ = service.FindLastPatientPrescriptionInfo(adminInfo.CurrentOrgId, id, recordDateTime)
|
|
657
|
+ }
|
|
658
|
+
|
|
659
|
+ //adminRole, _ := service.GetAdminUserInfoByID(adminInfo.CurrentOrgId, adminInfo.AdminUser.Id)
|
|
660
|
+
|
|
661
|
+ //diagnosisConfig, _ := service.FindDiagnoseById(diagnosis_id)
|
|
662
|
+ //sickConfig, _ := service.FindSickById(sick_type)
|
|
663
|
+ //miConfig, _ := service.FindMedicalInsuranceInfo(adminInfo.CurrentOrgId)
|
|
664
|
+ if patient.ID == 0 {
|
|
665
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodePatientNoExist)
|
|
666
|
+ return
|
|
667
|
+ }
|
|
668
|
+ if len(patient.IdCardNo) == 0 {
|
|
669
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeIDCartNo)
|
|
670
|
+ return
|
|
671
|
+ }
|
|
672
|
+ config, _ := service.GetMedicalInsuranceConfig(adminInfo.CurrentOrgId)
|
|
673
|
+
|
|
674
|
+ if config.IsOpen == 1 {
|
|
675
|
+
|
|
676
|
+ //c.ServeSuccessJSON(map[string]interface{}{
|
|
677
|
+ // "his_info": hisPatient,
|
|
678
|
+ //})
|
|
679
|
+ }
|
|
680
|
+}
|
|
681
|
+
|
677
|
682
|
//上传明细----预结算----确认订单
|
678
|
683
|
//func (c *SZHisApiController) GetUploadInfo() {
|
679
|
684
|
// id, _ := c.GetInt64("id")
|