export const HealthReportAnalysisItemConfig = [
  { category: 'tongue', key: 'tongueColor', subcategory: '舌色' },
  { category: 'tongue', key: 'tongueCoatingColor', subcategory: '苔色' },
  { category: 'tongue', key: 'tongueShape', subcategory: '舌形' },
  { category: 'tongue', key: 'tongueCoating', subcategory: '苔质' },
  { category: 'tongue', key: 'bodyFluid', subcategory: '津液' },
  { category: 'tongue', key: 'sublingualVein', subcategory: '舌下' },

  { category: 'face', key: 'faceColor', subcategory: '面色' },
  { category: 'face', key: 'mainColor', subcategory: '主色' },
  { category: 'face', key: 'shine', subcategory: '光泽' },
  // { category: 'face', key: 'leftBlackEye', subcategory: '左黑眼圈' },
  // { category: 'face', key: 'rightBlackEye', subcategory: '右黑眼圈' },
  { category: 'face', key: 'blackEye', subcategory: '黑眼圈' },
  { category: 'face', key: 'lipColor', subcategory: '唇色' },
  { category: 'face', key: 'eyeContact', subcategory: '眼神' },
  // { category: 'face', key: 'leftEyeColor', subcategory: '左目色' },
  // { category: 'face', key: 'rightEyeColor', subcategory: '右目色' },
  { category: 'face', key: 'eyeColor', subcategory: '目色' },
  { category: 'face', key: 'hecticCheek', subcategory: '两颧红' },
  { category: 'face', key: 'noseFold', subcategory: '鼻褶' },
  { category: 'face', key: 'cyanGlabella', subcategory: '眉间/鼻柱青色' },
  { category: 'face', key: 'faceSkinDefects', subcategory: '面部皮损' },
] as const;

type HealthReportAnalysisItem = (typeof HealthReportAnalysisItemConfig)[number];

export type HealthReportAnalysisKey = HealthReportAnalysisItem['key'];
export type HealthReportAnalysisCategory = HealthReportAnalysisItem['category'];
export type HealthReportAnalysisSubcategory = HealthReportAnalysisItem['subcategory'];

export const analysisPictureStrategy: Record<
  HealthReportAnalysisCategory,
  (data: any) => string[]
> = {
  face(data: any): string[] {
    const p1 = data.faceImg || data.faceImgUrl;
    const p2 = data.faceLeft || data.faceLeftImgUrl;
    const p3 = data.faceRight || data.faceRightImgUrl;
    return Object.assign([p1, p2, p3].filter(Boolean), {
      ['正面']: p1,
      ['左面']: p2,
      ['右面']: p3,
    });
  },
  tongue(data: any): string[] {
    const p1 = data.upImg || data.tongueImgUrl;
    const p2 = data.downImg || data.tongueBackImgUrl;
    return Object.assign([p1, p2].filter(Boolean), {
      ['舌上']: p1,
      ['舌下']: p2,
    });
  },
};

export const HealthReportSymptomItemConfig = {
  有一点: 2.0,
  偶尔: 2.0,
  轻: 2.0,
  有些: 3.0,
  有时: 3.0,
  中: 3.0,
  相当: 4.0,
  经常: 4.0,
  重: 4.0,
  非常: 5.0,
  总是: 5.0,
  非常重: 5.0,
} as const;
