# image — FRIDAY 影像 metadata(MySQL emr.med_check;PAC 不持文件本体)
# 影像不在 Mongo 病历文档内(全字段枚举证实),挂 emr_id(10 位病历号)回病历。
# 直接消费 med_check(class_name 由宿主 inline:class_code→std_check_class 已解析);modality 经共享字典翻
canonical: image

emits:
  action: image_uploaded
  subjectType: image
  occurredAtField: uploadedAt

primary:
  table: med_check
  key: id
  dedup_by: id

field_mapping:
  externalId:           id
  updatedAt:            updated_gmt_at
  createdAt:            created_gmt_at
  patientExternalId:    patient_id
  clinicId:             organization_id
  uploadedAt:           shooting_time     # 拍摄时间
  encounterExternalId:  emr_id            # 病历号级挂载(= med_emr_info.emr_id,非 emr_sub_id)
  modality:             class_name        # 宿主 inline(class_code→std_check_class 已解析)→ 共享字典翻
  fileUrl:              file_url          # OSS 相对路径(passthrough)
  fileName:             file_name

# ── 字典分层:真影像类型名共享(与 jvs-dw 实测同名);FRIDAY 特有名目留本地 ──
dict_includes:
  - ../../_shared/dict/image-modality.yaml

enum_mapping:
  modality:
    # FRIDAY 特有:胸片(987d743a 字典)→ 非口腔影像归 other;
    # 3a9d9c68 字典乱录("测试"/"1"/"11")与 lookup 未命中(class_name=null)→ _default
    胸片:                         other
    _default:                     other
