csx 3 年前
父节点
当前提交
286306f1a6
共有 2 个文件被更改,包括 13 次插入6 次删除
  1. 7 6
      controllers/his_api_controller.go
  2. 6 0
      service/his_service.go

+ 7 - 6
controllers/his_api_controller.go 查看文件

@@ -697,14 +697,15 @@ func (c *HisApiController) GetRegisterInfo() {
697 697
 	recordDateTime := theTime.Unix()
698 698
 
699 699
 	adminInfo := c.GetAdminUserInfo()
700
-	patient, _ := service.GetPatientByID(adminInfo.CurrentOrgId, id)
700
+	var patient service.Patients
701
+	if id == 0 {
702
+		patient, _ = service.GetPatientByIDCard(id_card, adminInfo.CurrentOrgId)
703
+	} else {
704
+		patient, _ = service.GetPatientByIDTwo(adminInfo.CurrentOrgId, id)
705
+	}
701 706
 	patientPrescription, _ := service.FindPatientPrescriptionInfo(adminInfo.CurrentOrgId, id, recordDateTime)
702
-
703 707
 	miConfig, _ := service.FindMedicalInsuranceInfo(adminInfo.CurrentOrgId)
704
-
705
-	fmt.Println(miConfig.SecretKey)
706
-
707
-	if patient == nil {
708
+	if patient.ID == 0 {
708 709
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodePatientNoExist)
709 710
 		return
710 711
 	}

+ 6 - 0
service/his_service.go 查看文件

@@ -946,3 +946,9 @@ func GetAppRole(orgID int64) (models.App_Role, error) {
946 946
 	err := readUserDb.Model(models.App_Role{}).Where("org_id = ? AND user_type = 2", orgID).First(&appRole).Error
947 947
 	return appRole, err
948 948
 }
949
+
950
+func GetPatientByIDTwo(orgID int64, patientID int64) (Patients, error) {
951
+	var patient Patients
952
+	err := readDb.Model(&Patients{}).Where("id = ? and user_org_id=? and status=1", patientID, orgID).First(&patient).Error
953
+	return patient, err
954
+}