Files
plates-server/src/health-profiles/dto/health-overview.dto.ts

82 lines
1.7 KiB
TypeScript

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;
};
}