新增获取就诊人列表-分页
This commit is contained in:
@@ -10,7 +10,7 @@ type PatientFamilyService struct {
|
||||
}
|
||||
|
||||
// GetPatientFamilyListByPatientId 获取患者家庭成员-患者id
|
||||
func (r *PatientFamilyService) GetPatientFamilyListByPatientId(patientId int64) (u []*patientFamilyResponse.GetUserPatient, err error) {
|
||||
func (r *PatientFamilyService) GetPatientFamilyListByPatientId(patientId int64) (u []*patientFamilyResponse.PatientFamily, err error) {
|
||||
patientFamilyDao := dao.PatientFamilyDao{}
|
||||
patientFamilys, err := patientFamilyDao.GetPatientFamilyListByPatientId(patientId)
|
||||
|
||||
@@ -19,24 +19,41 @@ func (r *PatientFamilyService) GetPatientFamilyListByPatientId(patientId int64)
|
||||
}
|
||||
|
||||
// 处理返回值
|
||||
items := make([]*patientFamilyResponse.GetUserPatient, len(patientFamilys))
|
||||
items := make([]*patientFamilyResponse.PatientFamily, len(patientFamilys))
|
||||
|
||||
if len(patientFamilys) > 0 {
|
||||
for i, v := range patientFamilys {
|
||||
// 将原始结构体转换为新结构体
|
||||
item := &patientFamilyResponse.GetUserPatient{
|
||||
FamilyId: fmt.Sprintf("%d", v.FamilyId),
|
||||
PatientId: fmt.Sprintf("%d", v.PatientId),
|
||||
Relation: &v.Relation,
|
||||
Status: &v.Status,
|
||||
IsDefault: &v.IsDefault,
|
||||
CardNameMask: v.CardNameMask,
|
||||
MobileMask: v.MobileMask,
|
||||
IdNumberMask: v.IdNumberMask,
|
||||
Sex: &v.Sex,
|
||||
Age: v.Age,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
item := &patientFamilyResponse.PatientFamily{
|
||||
FamilyId: fmt.Sprintf("%d", v.FamilyId),
|
||||
PatientId: fmt.Sprintf("%d", v.PatientId),
|
||||
Relation: &v.Relation,
|
||||
Status: &v.Status,
|
||||
IsDefault: &v.IsDefault,
|
||||
CardName: v.CardName,
|
||||
CardNameMask: v.CardNameMask,
|
||||
Mobile: v.Mobile,
|
||||
MobileMask: v.MobileMask,
|
||||
Type: &v.Type,
|
||||
IdNumber: v.IdNumber,
|
||||
IdNumberMask: v.IdNumberMask,
|
||||
Sex: &v.Sex,
|
||||
Age: v.Age,
|
||||
ProvinceId: fmt.Sprintf("%d", v.ProvinceId),
|
||||
Province: v.Province,
|
||||
CityId: fmt.Sprintf("%d", v.CityId),
|
||||
City: v.City,
|
||||
CountyId: fmt.Sprintf("%d", v.CountyId),
|
||||
County: v.County,
|
||||
Height: v.Height,
|
||||
Weight: v.Weight,
|
||||
MaritalStatus: &v.MaritalStatus,
|
||||
NationId: fmt.Sprintf("%d", v.NationId),
|
||||
NationName: v.NationName,
|
||||
JobId: fmt.Sprintf("%d", v.JobId),
|
||||
JobName: v.JobName,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
|
||||
Reference in New Issue
Block a user