|
@@ -44,6 +44,8 @@ func HisManagerApiRegistRouters() {
|
44
|
44
|
|
45
|
45
|
beego.Router("/api/code/get", &HisApiController{}, "get:GetCode")
|
46
|
46
|
|
|
47
|
+ beego.Router("/api/treatment/check", &HisApiController{}, "get:CheckTreatment")
|
|
48
|
+
|
47
|
49
|
}
|
48
|
50
|
|
49
|
51
|
func (c *HisApiController) Sscard() {
|
|
@@ -938,7 +940,7 @@ func (c *HisApiController) GetUploadInfo() {
|
938
|
940
|
mdtrt_id := his.Number
|
939
|
941
|
chrg_bchno := chrg_bchno
|
940
|
942
|
cert_no := his.Certno
|
941
|
|
- insutype := "310"
|
|
943
|
+ insutype := rf[0].Insutype
|
942
|
944
|
api := "http://127.0.0.1:9532/" + "gdyb/eight?cert_no=" + cert_no + "&insutype=" +
|
943
|
945
|
insutype + "&psn_no=" + psn_no + "&chrg_bchno=" + chrg_bchno + "&mdtrt_id=" + mdtrt_id +
|
944
|
946
|
"&total=" + allTotal + "&org_name=" + miConfig.OrgName + "&doctor=" + patientPrescription.Doctor + "&fixmedins_code=" + miConfig.Code + "&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey
|
|
@@ -1983,6 +1985,58 @@ func (c *HisApiController) GetCode() {
|
1983
|
1985
|
|
1984
|
1986
|
}
|
1985
|
1987
|
|
|
1988
|
+func (c *HisApiController) CheckTreatment() {
|
|
1989
|
+
|
|
1990
|
+ patient_id, _ := c.GetInt64("patient_id", 0)
|
|
1991
|
+ record_time := c.GetString("record_time")
|
|
1992
|
+ insutype := c.GetString("insutype")
|
|
1993
|
+
|
|
1994
|
+ timeLayout := "2006-01-02"
|
|
1995
|
+ loc, _ := time.LoadLocation("Local")
|
|
1996
|
+ adminUser := c.GetAdminUserInfo()
|
|
1997
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_time+" 00:00:00", loc)
|
|
1998
|
+ fmt.Println(err)
|
|
1999
|
+ if err != nil {
|
|
2000
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
2001
|
+ return
|
|
2002
|
+ }
|
|
2003
|
+ recordDateTime := theTime.Unix()
|
|
2004
|
+ his, _ := service.GetVMHisPatientInfo(adminUser.CurrentOrgId, patient_id, recordDateTime)
|
|
2005
|
+ patientPrescription, _ := service.FindPatientPrescriptionInfo(adminUser.CurrentOrgId, patient_id, recordDateTime)
|
|
2006
|
+
|
|
2007
|
+ miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
|
|
2008
|
+ config, _ := service.GetMedicalInsuranceConfig(adminUser.CurrentOrgId)
|
|
2009
|
+
|
|
2010
|
+ var user_name string
|
|
2011
|
+ role, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, adminUser.AdminUser.Id)
|
|
2012
|
+ if role.ID == 0 {
|
|
2013
|
+ user_name = "xxx"
|
|
2014
|
+ } else {
|
|
2015
|
+ user_name = role.UserName
|
|
2016
|
+ }
|
|
2017
|
+
|
|
2018
|
+ baseParams := models.BaseParams{
|
|
2019
|
+ SecretKey: miConfig.SecretKey,
|
|
2020
|
+ FixmedinsCode: miConfig.Code,
|
|
2021
|
+ InsuplcAdmdvs: miConfig.InsuplcAdmdvs,
|
|
2022
|
+ MdtrtareaAdmvs: miConfig.MdtrtareaAdmvs,
|
|
2023
|
+ OrgName: miConfig.OrgName,
|
|
2024
|
+ Doctor: user_name,
|
|
2025
|
+ }
|
|
2026
|
+
|
|
2027
|
+ if config.IsOpen == 1 {
|
|
2028
|
+ result := service.Gdyb2001(baseParams, his.PsnNo, insutype, strconv.FormatInt(patientPrescription.RegisterType, 10))
|
|
2029
|
+ var dat map[string]interface{}
|
|
2030
|
+ if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
|
2031
|
+ fmt.Println(dat)
|
|
2032
|
+ } else {
|
|
2033
|
+ fmt.Println(err)
|
|
2034
|
+ }
|
|
2035
|
+
|
|
2036
|
+ }
|
|
2037
|
+
|
|
2038
|
+}
|
|
2039
|
+
|
1986
|
2040
|
func PathExists(path string) (bool, error) {
|
1987
|
2041
|
_, err := os.Stat(path)
|
1988
|
2042
|
if err == nil {
|