feat(health-profiles): 添加健康档案模块,支持健康史记录、家庭健康管理和档案概览功能
This commit is contained in:
81
src/health-profiles/dto/health-overview.dto.ts
Normal file
81
src/health-profiles/dto/health-overview.dto.ts
Normal file
@@ -0,0 +1,81 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
/**
|
||||
* 基础信息概览
|
||||
*/
|
||||
export class BasicInfoOverviewDto {
|
||||
@ApiProperty({ description: '完成度百分比' })
|
||||
progress: number;
|
||||
|
||||
@ApiProperty({
|
||||
description: '基础数据',
|
||||
example: {
|
||||
height: '175',
|
||||
weight: '70',
|
||||
bmi: '22.9',
|
||||
waistCircumference: 80,
|
||||
},
|
||||
})
|
||||
data: {
|
||||
height?: string;
|
||||
weight?: string;
|
||||
bmi?: string;
|
||||
waistCircumference?: number;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 健康史概览
|
||||
*/
|
||||
export class HealthHistoryOverviewDto {
|
||||
@ApiProperty({ description: '完成度百分比' })
|
||||
progress: number;
|
||||
|
||||
@ApiProperty({ description: '已回答的分类', type: [String] })
|
||||
answeredCategories: string[];
|
||||
|
||||
@ApiProperty({ description: '待回答的分类', type: [String] })
|
||||
pendingCategories: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 药物管理概览
|
||||
*/
|
||||
export class MedicationsOverviewDto {
|
||||
@ApiProperty({ description: '当前用药数量' })
|
||||
activeCount: number;
|
||||
|
||||
@ApiProperty({ description: '今日服药完成率' })
|
||||
todayCompletionRate: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 健康档案概览响应 DTO
|
||||
*/
|
||||
export class GetHealthOverviewResponseDto {
|
||||
@ApiProperty()
|
||||
code: number;
|
||||
|
||||
@ApiProperty()
|
||||
message: string;
|
||||
|
||||
@ApiProperty({
|
||||
example: {
|
||||
basicInfo: {
|
||||
progress: 100,
|
||||
data: { height: '175', weight: '70', bmi: '22.9', waistCircumference: 80 },
|
||||
},
|
||||
healthHistory: {
|
||||
progress: 75,
|
||||
answeredCategories: ['allergy', 'disease', 'surgery'],
|
||||
pendingCategories: ['familyDisease'],
|
||||
},
|
||||
medications: { activeCount: 3, todayCompletionRate: 66.7 },
|
||||
},
|
||||
})
|
||||
data: {
|
||||
basicInfo: BasicInfoOverviewDto;
|
||||
healthHistory: HealthHistoryOverviewDto;
|
||||
medications: MedicationsOverviewDto;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user