Chuyển đến nội dung chính

Bài 12: Terminologies - CodeSystem, ValueSet, ConceptMap

Hệ thống thuật ngữ y tế: ICD-10 (chẩn đoán), SNOMED CT (lâm sàng), LOINC (xét nghiệm), RxNorm (thuốc), CPT (thủ thuật), ATC (phân loại thuốc). CodeSystem, ValueSet, ConceptMap trong FHIR. Terminology binding (required, extensible, preferred, example). $validate-code, $expand, $lookup.

🏗️ Kiến trúc — Bài 12 Bài 12: Terminologies - CodeSystem, ValueSet, ConceptMap

HL7 FHIR - Chuẩn Dữ liệu Y tế từ Cơ bản đến Nâng cao

Phần 4: Data Types, Terminologies và Profiles

xdev.asia

Xem bản video

1. Các hệ thống thuật ngữ y tế chính

Hệ thốngTổ chứcMục đíchFHIR system URI
ICD-10WHOPhân loại bệnh tật, nguyên nhân tử vonghttp://hl7.org/fhir/sid/icd-10
SNOMED CTSNOMED Int'lThuật ngữ lâm sàng toàn diệnhttp://snomed.info/sct
LOINCRegenstriefXét nghiệm, quan sát lâm sànghttp://loinc.org
RxNormNLMTên thuốc chuẩn hóa (Hoa Kỳ)http://www.nlm.nih.gov/research/umls/rxnorm
ATCWHOPhân loại thuốc theo nhóm (quốc tế)http://www.whocc.no/atc
CPTAMAMã thủ thuật / dịch vụ y tếhttp://www.ama-assn.org/go/cpt
CVXCDCMã vaccinehttp://hl7.org/fhir/sid/cvx
UCUMRegenstriefĐơn vị đo lườnghttp://unitsofmeasure.org

ICD-10 — International Classification of Diseases

Sử dụng cho Condition.code, Encounter.diagnosis. Việt Nam sử dụng ICD-10 chính thức (WHO).

{
  "system": "http://hl7.org/fhir/sid/icd-10",
  "code": "E11.9",
  "display": "Type 2 diabetes mellitus without complications"
}

SNOMED CT — Systematized Nomenclature of Medicine

Hệ thống thuật ngữ toàn diện nhất, 350,000+ concepts, quan hệ phân cấp (ontology).

{
  "system": "http://snomed.info/sct",
  "code": "73211009",
  "display": "Diabetes mellitus"
}

LOINC — Logical Observation Identifiers Names and Codes

97,000+ codes cho xét nghiệm và quan sát lâm sàng. Dùng cho Observation.code, DiagnosticReport.code.

{
  "system": "http://loinc.org",
  "code": "4548-4",
  "display": "Hemoglobin A1c/Hemoglobin.total in Blood"
}

2. CodeSystem Resource

CodeSystem định nghĩa tập hợp các concepts (codes) — có thể là hệ thống quốc tế hoặc custom.

{
  "resourceType": "CodeSystem",
  "url": "http://hospital.vn/fhir/CodeSystem/loai-kham",
  "name": "LoaiKham",
  "title": "Loại hình khám chữa bệnh",
  "status": "active",
  "content": "complete",
  "count": 5,
  "concept": [
    {
      "code": "KSK",
      "display": "Khám sức khỏe",
      "definition": "Khám sức khỏe tổng quát định kỳ"
    },
    {
      "code": "KBT",
      "display": "Khám bệnh thường",
      "definition": "Khám bệnh ngoại trú thông thường"
    },
    {
      "code": "CC",
      "display": "Cấp cứu",
      "definition": "Khám cấp cứu"
    },
    {
      "code": "BHYT",
      "display": "Khám BHYT",
      "definition": "Khám bảo hiểm y tế"
    },
    {
      "code": "DV",
      "display": "Khám dịch vụ",
      "definition": "Khám theo yêu cầu (dịch vụ)"
    }
  ]
}

3. ValueSet Resource

ValueSet chọn lọc một tập con từ một hoặc nhiều CodeSystems.

{
  "resourceType": "ValueSet",
  "url": "http://hospital.vn/fhir/ValueSet/vital-signs-codes",
  "name": "VitalSignsCodes",
  "title": "Mã dấu hiệu sinh tồn",
  "status": "active",
  "compose": {
    "include": [
      {
        "system": "http://loinc.org",
        "concept": [
          {"code": "8480-6", "display": "Systolic blood pressure"},
          {"code": "8462-4", "display": "Diastolic blood pressure"},
          {"code": "8867-4", "display": "Heart rate"},
          {"code": "8310-5", "display": "Body temperature"},
          {"code": "9279-1", "display": "Respiratory rate"},
          {"code": "2708-6", "display": "Oxygen saturation (SpO2)"},
          {"code": "29463-7", "display": "Body weight"},
          {"code": "8302-2", "display": "Body height"}
        ]
      }
    ]
  }
}

ValueSet với Filter

{
  "resourceType": "ValueSet",
  "url": "http://hospital.vn/fhir/ValueSet/icd10-cardiovascular",
  "compose": {
    "include": [
      {
        "system": "http://hl7.org/fhir/sid/icd-10",
        "filter": [
          {
            "property": "concept",
            "op": "is-a",
            "value": "I00-I99"
          }
        ]
      }
    ],
    "exclude": [
      {
        "system": "http://hl7.org/fhir/sid/icd-10",
        "concept": [
          {"code": "I99"}
        ]
      }
    ]
  }
}

4. ConceptMap — Ánh xạ giữa CodeSystems

{
  "resourceType": "ConceptMap",
  "url": "http://hospital.vn/fhir/ConceptMap/icd10-to-snomed",
  "name": "ICD10ToSNOMED",
  "title": "ICD-10 → SNOMED CT Mapping",
  "status": "active",
  "sourceScope": "http://hl7.org/fhir/sid/icd-10",
  "targetScope": "http://snomed.info/sct",
  "group": [
    {
      "source": "http://hl7.org/fhir/sid/icd-10",
      "target": "http://snomed.info/sct",
      "element": [
        {
          "code": "I10",
          "display": "Essential (primary) hypertension",
          "target": [
            {
              "code": "38341003",
              "display": "Hypertensive disorder",
              "relationship": "equivalent"
            }
          ]
        },
        {
          "code": "E11",
          "display": "Type 2 diabetes mellitus",
          "target": [
            {
              "code": "44054006",
              "display": "Type 2 diabetes mellitus",
              "relationship": "equivalent"
            }
          ]
        }
      ]
    }
  ]
}

Relationship Types

RelationshipMô tả
equivalentTương đương hoàn toàn
source-is-narrower-than-targetSource hẹp hơn target
source-is-broader-than-targetSource rộng hơn target
not-related-toKhông liên quan

5. Terminology Binding

Binding quy định element BẮT BUỘC dùng codes từ ValueSet nào.

StrengthMô tảVí dụ
requiredBẮT BUỘC dùng code từ ValueSetPatient.gender
extensibleNÊN dùng. Có thể dùng code khác nếu không tìm thấyCondition.code
preferredKHUYẾN NGHỊ. Có thể dùng code khácEncounter.type
exampleChỉ ví dụ. Dùng ValueSet nào cũng đượcObservation.code
FHIR khoá cứng cờ quy trình, và để mở thứ mang nghĩa Bốn mức ràng buộc thuật ngữ của FHIR R5, từ required đến example, với Observation.status ở required và Observation.code ở example. FHIR khoá cứng cờ quy trình, và để mở thứ mang nghĩa
<text x="48" y="111" font-size="12" font-weight="650" letter-spacing="1.8">CHẶT NHẤT</text>
<text x="1152" y="111" font-size="12" font-weight="650" letter-spacing="1.8" text-anchor="end">LỎNG NHẤT</text>
<line x1="142" y1="107" x2="1052" y2="107" stroke="var(--n-divider)" stroke-width="1"/>

<line x1="70" y1="155" x2="70" y2="495" stroke="var(--n-divider)" stroke-width="1"/>

<g>
  <circle cx="70" cy="176" r="5" fill="var(--n-surface)" stroke="var(--n-divider)" stroke-width="1"/>
  <rect x="102" y="132" width="760" height="88" fill="var(--n-surface)" stroke="var(--n-divider)" stroke-width="1"/>
  <text x="126" y="163" font-size="14" font-weight="700" letter-spacing="2.2">REQUIRED</text>
  <text x="126" y="190" font-size="14" opacity="0.72">
    <tspan x="126" dy="0">To be conformant, the concept in this element SHALL be from the</tspan>
    <tspan x="126" dy="20">specified value set.</tspan>
  </text>
</g>

<g>
  <circle cx="70" cy="284" r="5" fill="var(--n-surface)" stroke="var(--n-divider)" stroke-width="1"/>
  <rect x="102" y="240" width="760" height="88" fill="var(--n-surface)" stroke="var(--n-divider)" stroke-width="1"/>
  <text x="126" y="271" font-size="14" font-weight="700" letter-spacing="2.2">EXTENSIBLE</text>
  <text x="126" y="298" font-size="14" opacity="0.72">
    <tspan x="126" dy="0">SHALL be from the specified value set if any of the codes within the</tspan>
    <tspan x="126" dy="20">value set can apply.</tspan>
  </text>
</g>

<g>
  <circle cx="70" cy="392" r="5" fill="var(--n-surface)" stroke="var(--n-divider)" stroke-width="1"/>
  <rect x="102" y="348" width="760" height="88" fill="var(--n-surface)" stroke="var(--n-divider)" stroke-width="1"/>
  <text x="126" y="379" font-size="14" font-weight="700" letter-spacing="2.2">PREFERRED</text>
  <text x="126" y="406" font-size="14" opacity="0.72">
    <tspan x="126" dy="0">Instances are encouraged to draw from the specified codes … but are not</tspan>
    <tspan x="126" dy="20">required to do so to be considered conformant.</tspan>
  </text>
</g>

<g>
  <circle cx="70" cy="500" r="5" fill="var(--n-surface)" stroke="var(--n-divider)" stroke-width="1"/>
  <rect x="102" y="456" width="760" height="88" fill="var(--n-surface)" stroke="var(--n-divider)" stroke-width="1"/>
  <text x="126" y="487" font-size="14" font-weight="700" letter-spacing="2.2">EXAMPLE</text>
  <text x="126" y="514" font-size="14" opacity="0.72">
    <tspan x="126" dy="0">Instances are not expected or even encouraged to draw from the</tspan>
    <tspan x="126" dy="20">specified value set.</tspan>
  </text>
</g>

<g>
  <path d="M862 176 H894" fill="none" stroke="var(--n-accent)" stroke-width="1"/>
  <circle cx="894" cy="176" r="4" fill="var(--n-accent)"/>
  <text x="914" y="161" font-size="15" font-weight="700" fill="var(--n-accent)">Observation.status</text>
  <text x="914" y="188" font-size="13" fill="var(--n-accent)">cờ quy trình</text>
</g>

<g>
  <path d="M862 500 H894" fill="none" stroke="var(--n-accent)" stroke-width="1"/>
  <circle cx="894" cy="500" r="4" fill="var(--n-accent)"/>
  <text x="914" y="485" font-size="15" font-weight="700" fill="var(--n-accent)">Observation.code</text>
  <text x="914" y="512" font-size="13" font-weight="650" fill="var(--n-accent)">thứ nói ĐÃ ĐO CÁI GÌ</text>
</g>

<line x1="48" y1="568" x2="1152" y2="568" stroke="var(--n-divider)" stroke-width="1"/>
<text x="48" y="594" font-size="12" opacity="0.72">Nguồn: HL7 FHIR R5 (v5.0.0) — terminologies.html, observation.html</text>
Bảng trên liệt kê bốn mức. Chỗ đáng chú ý là hai mức đó rơi vào đâu trong cùng một resource: Observation.status — một cờ quy trình — ở mức required, còn Observation.code, thứ nói đã đo cái gì, ở mức example.

6. Terminology Service Operations

# $validate-code — kiểm tra code có hợp lệ trong ValueSet
POST /ValueSet/$validate-code
{
  "resourceType": "Parameters",
  "parameter": [
    {"name": "url", "valueUri": "http://hl7.org/fhir/ValueSet/administrative-gender"},
    {"name": "code", "valueCode": "male"},
    {"name": "system", "valueUri": "http://hl7.org/fhir/administrative-gender"}
  ]
}

# $expand — mở rộng ValueSet ra danh sách codes
GET /ValueSet/$expand?url=http://hospital.vn/fhir/ValueSet/vital-signs-codes

# $lookup — tra cứu thông tin code
GET /CodeSystem/$lookup?system=http://loinc.org&code=4548-4

# $translate — ánh xạ code qua ConceptMap
GET /ConceptMap/$translate?system=http://hl7.org/fhir/sid/icd-10&code=I10&target=http://snomed.info/sct

7. Tổng kết

  • CodeSystem — Định nghĩa tập codes (ICD-10, SNOMED CT, LOINC, hoặc custom)

  • ValueSet — Chọn lọc subset từ CodeSystems, dùng cho binding

  • ConceptMap — Ánh xạ giữa CodeSystems (ICD-10 ↔ SNOMED CT)

  • Binding strengths — required > extensible > preferred > example

  • Terminology operations — $validate-code, $expand, $lookup, $translate