csx пре 3 година
родитељ
комит
d5b38221e4
3 измењених фајлова са 97 додато и 92 уклоњено
  1. 13 12
      controllers/sg/his_api_controller.go
  2. 84 79
      controllers/sz/sz_his_api_controller.go
  3. 0 1
      service/sz_his_service.go

+ 13 - 12
controllers/sg/his_api_controller.go Прегледај датотеку

@@ -21,7 +21,6 @@ import (
21 21
 	"os"
22 22
 	"path/filepath"
23 23
 	"runtime"
24
-	_ "runtime/cgo"
25 24
 	"strconv"
26 25
 	"strings"
27 26
 	"syscall"
@@ -55,6 +54,11 @@ func HisManagerApiRegistRouters() {
55 54
 
56 55
 }
57 56
 
57
+var (
58
+	str  = make([]byte, 256)
59
+	str1 = make([]byte, 256)
60
+)
61
+
58 62
 func (c *HisApiController) TestPay() {
59 63
 	runtime.GC()
60 64
 	DllDef := syscall.MustLoadDLL("SSSE32.dll")
@@ -87,17 +91,14 @@ func (c *HisApiController) TestGetBasBaseInfo() {
87 91
 	result := int(ret)
88 92
 	fmt.Println("SSCard的运算结果为1:", result)
89 93
 
90
-	if readCard == nil {
91
-		fmt.Println("readcard is nil")
92
-		readCard = DllDef.MustFindProc("ReadCardBas")
93
-	}
94
-	if readCard == nil {
95
-		fmt.Println("readcard reload  is nil")
96
-		return
97
-	}
98
-
99
-	str := make([]byte, 256)
100
-	str1 := make([]byte, 256)
94
+	//if readCard == nil {
95
+	//	fmt.Println("readcard is nil")
96
+	//	readCard = DllDef.MustFindProc("ReadCardBas")
97
+	//}
98
+	//if readCard == nil {
99
+	//	fmt.Println("readcard reload  is nil")
100
+	//	return
101
+	//}
101 102
 	ret2, _, err2 := readCard.Call((uintptr)(unsafe.Pointer(&str[0])), IntPtr(1024), (uintptr)(unsafe.Pointer(&str1[0])), IntPtr(1024))
102 103
 	fmt.Println(" Add(4,5)的结果为:", ret2)
103 104
 	fmt.Println(" str:", str)

+ 84 - 79
controllers/sz/sz_his_api_controller.go Прегледај датотеку

@@ -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")

+ 0 - 1
service/sz_his_service.go Прегледај датотеку

@@ -58,7 +58,6 @@ func SzybMZ002(doctor string, doctor_code string, fixmedins_code string, dept_co
58 58
 	str := string(respBytes)
59 59
 	return str
60 60
 }
61
-
62 61
 func SzybFY001(doctor string, doctor_code string, fixmedins_code string, dept_code string, datas []*models.CustomDetail) string {
63 62
 	// 生成输入报文
64 63
 	inputMessage := SetSZInputMessage(doctor, doctor_code, fixmedins_code)