export const VISIT_RECORD_TEMPLATES = [
  {
    templateType: 'outpatient',
    templateName: '门诊记录',
    service: { timeTitle: 'visitTime', timeName: '就诊日期' },
    templateList: [
      { title: 'visitTime', name: '就诊日期', type: 'date', operateType: 'formCell', required: false, format: 'YYYY-MM-DD', placeholder: '请选择就诊日期' },
      { title: 'chiefComplaint', name: '主诉', type: 'textarea', operateType: 'formCell', required: false, wordLimit: 200, placeholder: '请输入或说话录音转录问题', rows: 1, autoHeight: true },
      { title: 'medicalHistory', name: '病史概要', type: 'textarea', operateType: 'formCell', required: false, wordLimit: 500, placeholder: '请简述患者情况，量键既往病史、用药史等', rows: 3, autoHeight: true },
      { title: 'examination', name: '检查', type: 'textarea', operateType: 'formCell', required: false, wordLimit: 500, placeholder: '请填写关键项目或异常结果描述', rows: 1, autoHeight: true },
      { title: 'diagnosis', name: '诊断', type: 'diagnosis', operateType: 'formCell', required: false, wordLimit: 200, placeholder: '请选择诊断', supportVoice: true, rows: 1, autoHeight: true },
      { title: 'treatmentPlan', name: '治疗方案', type: 'textarea', operateType: 'formCell', required: false, wordLimit: 1000, placeholder: '请简述治疗方案及效果', rows: 3, autoHeight: true },
      { title: 'files', name: '文件上传', type: 'files', required: false, desc: '(仅支持拍摄/相册选择图片，≤5M)', maxSize: 5, accept: 'image' },
    ],
  },
  {
    templateType: 'inhospital',
    templateName: '住院记录',
    service: { timeTitle: 'inhosDate', timeName: '入院日期' },
    templateList: [
      { title: 'inhosDate', name: '入院日期', type: 'date', operateType: 'formCell', required: false, format: 'YYYY-MM-DD', placeholder: '请选择入院日期' },
      { title: 'chiefComplaint', name: '主诉', type: 'textarea', operateType: 'formCell', required: false, wordLimit: 200, placeholder: '请输入病症与转诊问题', rows: 1, autoHeight: true },
      { title: 'medicalHistory', name: '病史概要', type: 'textarea', operateType: 'formCell', required: false, wordLimit: 500, placeholder: '请简述患者情况，量键既往病史、用药史等症状', rows: 3, autoHeight: true },
      { title: 'examination', name: '检查', type: 'textarea', operateType: 'formCell', required: false, wordLimit: 500, placeholder: '请填写关键项目或异常结果描述', rows: 1, autoHeight: true },
      { title: 'diagnosis', name: '住院主诊断', type: 'diagnosis', operateType: 'formCell', required: false, wordLimit: 200, placeholder: '请选择诊断', rows: 1, autoHeight: true },
      { title: 'surgeryDate', name: '手术日期', type: 'date', operateType: 'formCell', required: false, format: 'YYYY-MM-DD', placeholder: '请选择手术日期' },
      { title: 'surgeryName', name: '手术名称', type: 'textarea', operateType: 'formCell', required: false, wordLimit: 100, placeholder: '请填写手术名称', rows: 1, autoHeight: true },
      { title: 'treatmentPlan', name: '治疗方案', type: 'textarea', operateType: 'formCell', required: false, wordLimit: 1000, placeholder: '请简述治疗方案及效果', rows: 3, autoHeight: true },
      { title: 'files', name: '文件上传', type: 'files', required: false, desc: '(仅支持拍摄/相册选择图片，≤5M)', maxSize: 5, accept: 'image' },
    ],
  },
  {
    templateType: 'preConsultationRecord',
    templateName: '预问诊记录',
    service: { timeTitle: 'consultDate', timeName: '问诊日期' },
    templateList: [
      { title: 'chiefComplaint', name: '主诉', type: 'textarea', operateType: 'formCell', required: false, wordLimit: 200, placeholder: '请输入症状及转诊问题', rows: 1, autoHeight: true },
      { title: 'presentIllness', name: '现病史', type: 'textarea', operateType: 'formCell', required: false, wordLimit: 800, placeholder: '请述述发病的过程、发展、诊疗经过及当前病情', rows: 3, autoHeight: true },
      { title: 'pastHistory', name: '既往史', type: 'textarea', operateType: 'formCell', required: false, wordLimit: 800, placeholder: '请填写既往疾病、手术/外伤史、药物/食物过敏史', rows: 3, autoHeight: true },
      { title: 'files', name: '文件上传', type: 'files', required: false, desc: '(仅支持拍摄/相册选择图片，≤5M)', maxSize: 5, accept: 'image' },
    ],
  },
  {
    templateType: 'physicalExaminationTemplate',
    templateName: '体检记录',
    service: { timeTitle: 'inspectDate', timeName: '体检日期' },
    templateList: [
      { title: 'inspectDate', name: '体检日期', type: 'date', operateType: 'formCell', required: false, format: 'YYYY-MM-DD', placeholder: '请选择体检日期' },
      { title: 'summary', name: '体检小结', type: 'textarea', operateType: 'formCell', required: false, wordLimit: 200, placeholder: '请填写本次体检的小结', rows: 3, autoHeight: true },
      { title: 'positiveFind', name: '阳性发现及处理意见', type: 'textarea', operateType: 'formCell', required: false, wordLimit: 500, placeholder: '可参照医客通现有模式', rows: 3, refNote: '可参照医客通现有模式', autoHeight: true },
      { title: 'files', name: '文件上传', type: 'files', required: false, desc: '(仅支持拍摄/相册选择图片，≤5M)', maxSize: 5, accept: 'image' },
    ],
  },
];

export function getVisitRecordTemplates() {
  return VISIT_RECORD_TEMPLATES.map((i) => ({ templateType: i.templateType, name: i.templateName, templateList: i.templateList }));
}

export function getVisitRecordTemplate(templateType) {
  return VISIT_RECORD_TEMPLATES.find((i) => i.templateType === templateType) || null;
}
