新增获取就诊人详情

This commit is contained in:
2023-09-19 08:41:21 +08:00
parent 9d21730305
commit 43d5023b80
9 changed files with 214 additions and 97 deletions
@@ -3,6 +3,8 @@ package patientFamilyResponse
import (
"fmt"
"hospital-admin-api/api/model"
"hospital-admin-api/api/responses/userResponse"
"hospital-admin-api/utils"
)
type PatientFamily struct {
@@ -66,6 +68,38 @@ type getPatientFamilyPage struct {
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
}
// GetPatientFamily 就诊人详情
type GetPatientFamily struct {
FamilyId string `json:"family_id"` // 主键id
PatientId string `json:"patient_id"` // 患者id
Relation *int `json:"relation"` // 与患者关系(1:本人 2:父母 3:爱人 4:子女 5:亲戚 6:其他)
Status *int `json:"status"` // 状态(1:正常 2:删除)
IsDefault *int `json:"is_default"` // 是否默认(0:否 1:是)
CardName string `json:"card_name"` // 姓名
CardNameMask string `json:"card_name_mask"` // 姓名(掩码)
MobileMask string `json:"mobile_mask"` // 电话(掩码)
Type *int `json:"type"` // 身份类型(1:身份证 2:护照 3:港澳通行证 4:台胞证)
IdNumberMask string `json:"id_number_mask"` // 证件号码(掩码)
Sex *int `json:"sex"` // 性别(0:未知 1:男 2:女)
Age int `json:"age"` // 年龄
ProvinceId string `json:"province_id"` // 省份id
Province string `json:"province"` // 省份
CityId string `json:"city_id"` // 城市id
City string `json:"city"` // 城市
CountyId string `json:"county_id"` // 区县id
County string `json:"county"` // 区县
Height string `json:"height"` // 身高(cm
Weight string `json:"weight"` // 体重(kg
MaritalStatus *int `json:"marital_status"` // 婚姻状况(0:未婚 1:已婚 2:离异)
NationId string `json:"nation_id"` // 民族
NationName string `json:"nation_name"` // 民族名称
JobId string `json:"job_id"` // 职业
JobName string `json:"job_name"` // 职业名称
User *userResponse.User `json:"user"` // 用户
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
}
// GetUserPatientResponse 获取患者详情
func GetUserPatientResponse(patientFamilys []*model.PatientFamily) []*GetUserPatient {
// 处理返回值
@@ -111,7 +145,7 @@ func GetPatientFamilyPageResponse(patientFamily []*model.PatientFamily) []getPat
Relation: &v.Relation,
Status: &v.Status,
CardName: v.CardName,
MobileMask: v.MobileMask,
MobileMask: utils.MaskPhoneStr(v.UserPatient.User.Mobile),
UserName: v.UserPatient.UserName,
CreatedAt: v.CreatedAt,
UpdatedAt: v.UpdatedAt,