HL7 Vietnam VN Core FHIR Implementation Guide

Bộ Hướng dẫn Triển khai Core FHIR cho Việt Nam
0.5.0 - Draft for Community Review Viet Nam cờ

Bộ Hướng dẫn Triển khai Core FHIR cho Việt Nam - Draft for Community Review (v0.5.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

: Bảng 2 thuốc BHYT — Logical Model — StructureMap

Draft tại thời điểm 2026-04-28

Bản thô json | Tải xuống

{
  "resourceType" : "StructureMap",
  "id" : "vn-sm-bhyt-xml2-medication",
  "language" : "vi",
  "text" : {
    "status" : "generated",
    "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: StructureMap vn-sm-bhyt-xml2-medication</b></p><a name=\"vn-sm-bhyt-xml2-medication\"> </a><a name=\"hcvn-sm-bhyt-xml2-medication\"> </a><pre class=\"fml\">\r\n<b>map</b><span style=\"color: navy\"> &quot;</span>http://fhir.hl7.org.vn/core/StructureMap/vn-sm-bhyt-xml2-medication<span style=\"color: navy\">&quot; = &quot;</span>BHYTXML2MedicationLMStructureMap<span style=\"color: navy\">&quot;\r\n\r\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">Generated StructureMap scaffold for Bảng 2 thuốc BHYT — Logical Model. Source semantics come from the logical model mapping annotations in `BHYTXML2MedicationLM.fsh` and remain aligned with the Python BHYT round-trip export adapter.</span>\r\n\r\n<b>uses</b><span style=\"color: navy\"> &quot;</span><a href=\"StructureDefinition-vn-core-bhyt-submission-bundle.html\" title=\"Bundle hồ sơ thanh toán BHYT — VN Core BHYT Submission Bundle\">http://fhir.hl7.org.vn/core/StructureDefinition/vn-core-bhyt-submission-bundle</a><span style=\"color: navy\">&quot; </span><b>alias </b>BHYTSubmissionBundle <b>as </b><b>source</b> <span style=\"color: navy\">// </span><span style=\"color: green\">FHIR-native source bundle profile used by the repository round-trip adapter.</span>\r\n<b>uses</b><span style=\"color: navy\"> &quot;</span><a href=\"StructureDefinition-bhytXml2MedicationLm.html\" title=\"Bảng 2 thuốc BHYT — Logical Model\">http://fhir.hl7.org.vn/core/StructureDefinition/bhytXml2MedicationLm</a><span style=\"color: navy\">&quot; </span><b>alias </b>BHYTXML2MedicationLM <b>as </b><b>target</b> <span style=\"color: navy\">// </span><span style=\"color: green\">Bảng 2 thuốc BHYT — Logical Model</span>\r\n\r\n<span style=\"color: navy\">// </span><span style=\"color: green\">Full QD 3176 XML2 field catalog. MA_NHOM uses the QD 3176 source code system and must be mapped to QD 697/VNCostCategoryCS with a ConceptMap. Generated from logical-model `^mapping` annotations. Fields still missing a field-level `^mapping.map` entry remain outside this StructureMap and are tracked in `wiki/mappings/bhyt-output-data/machine/structuremap-coverage.json`.</span>\r\n<b>group </b>MapBHYTXML2MedicationLM<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">sourceBundle</span><span style=\"color: navy\"> : </span>BHYTSubmissionBundle, <b>target</b> <span style=\"color: maroon\">targetRow</span><span style=\"color: navy\"> : </span>BHYTXML2MedicationLM<span style=\"color: navy\">)</span><span style=\"color: navy\"> {\r\n</span>  sourceBundle.entry<b> as </b><span style=\"color: maroon\">maLkSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.maLk <i>&quot;maLk&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: MA_LK - Mã liên kết hồ sơ FHIR path: VNCoreClaim.identifier[MALK].value</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">sttSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.stt <i>&quot;stt&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: STT - Số thứ tự dòng FHIR path: VNCoreClaim.item[medicationLine].sequence</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">maThuocSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.maThuoc <i>&quot;maThuoc&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: MA_THUOC - Mã thuốc FHIR path: VNCoreMedication.code.coding.code | VNCoreClaim.item[medicationLine].productOrService.coding.code</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">maPpChebienSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.maPpChebien <i>&quot;maPpChebien&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: MA_PP_CHEBIEN - Mã phương pháp chế biến FHIR path: VNCoreClaim.item[medicationLine].extension[processingMethod].valueString | VNCoreExplanationOfBenefit.item[medicationLine].extension[processingMethod].valueString | VNCoreMedication.extension[processingMethod].valueString | VNCoreMedicationRequest.extension[processingMethod].valueString | VNCoreMedicationDispense.extension[processingMethod].valueString</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">maCskcbThuocSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.maCskcbThuoc <i>&quot;maCskcbThuoc&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: MA_CSKCB_THUOC - Mã cơ sở KCB cấp thuốc FHIR path: VNCoreMedicationDispense.performer.actor.resolve().identifier[CSKCB].value | VNCoreMedicationDispense.location.resolve().identifier[CSKCB].value</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">maNhomSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.maNhom <i>&quot;maNhom&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: MA_NHOM - Mã nhóm chi phí theo QĐ 3176 FHIR path: ConceptMap/vn-cm-qd3176-cost-group-to-q697-cost-category -&gt; VNCoreClaim.item[medicationLine].category.coding.code Mapping note: QD 3176 uses MA_NHOM=4 for medication; StructureMap must first apply the ConceptMap, then populate VNCostCategoryCS#8. Do not assign the QD 3176 code directly to VNCostCategoryCS.</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">tenThuocSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.tenThuoc <i>&quot;tenThuoc&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: TEN_THUOC - Tên thuốc FHIR path: VNCoreMedication.code.text | VNCoreClaim.item[medicationLine].productOrService.text | display</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">donViTinhSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.donViTinh <i>&quot;donViTinh&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: DON_VI_TINH - Đơn vị tính FHIR path: VNCoreClaim.item[medicationLine].quantity.unit</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">hamLuongSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.hamLuong <i>&quot;hamLuong&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: HAM_LUONG - Hàm lượng FHIR path: VNCoreMedication.ingredient.strength | Medication.code.text</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">duongDungSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.duongDung <i>&quot;duongDung&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: DUONG_DUNG - Đường dùng FHIR path: VNCoreMedicationRequest.dosageInstruction.route</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">dangBaoCheSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.dangBaoChe <i>&quot;dangBaoChe&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: DANG_BAO_CHE - Dạng bào chế FHIR path: VNCoreMedication.form.coding.code | VNCoreMedication.form.text</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">lieuDungSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.lieuDung <i>&quot;lieuDung&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: LIEU_DUNG - Liều dùng FHIR path: VNCoreMedicationRequest.dosageInstruction.doseAndRate</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">cachDungSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.cachDung <i>&quot;cachDung&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: CACH_DUNG - Cách dùng FHIR path: VNCoreMedicationRequest.dosageInstruction.text</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">soDangKySource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.soDangKy <i>&quot;soDangKy&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: SO_DANG_KY - Số đăng ký thuốc FHIR path: VNCoreMedication.extension[registrationNumber].valueString | VNCoreMedicationRequest.extension[registrationNumber].valueString | VNCoreMedicationDispense.extension[registrationNumber].valueString</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">ttThauSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.ttThau <i>&quot;ttThau&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: TT_THAU - Thông tin thầu FHIR path: VNCoreClaim.item[medicationLine].extension[tenderInfo].valueString | VNCoreExplanationOfBenefit.item[medicationLine].extension[tenderInfo].valueString | VNCoreMedication.extension[tenderInfo].valueString | VNCoreMedicationRequest.extension[tenderInfo].valueString | VNCoreMedicationDispense.extension[tenderInfo].valueString</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">phamViSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.phamVi <i>&quot;phamVi&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: PHAM_VI - Phạm vi thanh toán FHIR path: VNCoreClaim.item[medicationLine].extension[insuranceCostInfo].extension[scope].valueCodeableConcept</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">tyleTtBhSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.tyleTtBh <i>&quot;tyleTtBh&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: TYLE_TT_BH - Tỷ lệ thanh toán BHYT FHIR path: VNCoreClaim.item[medicationLine].extension[insuranceCostInfo].extension[paymentRatio].valueDecimal</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">soLuongSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.soLuong <i>&quot;soLuong&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: SO_LUONG - Số lượng FHIR path: VNCoreClaim.item[medicationLine].quantity.value | VNCoreMedicationDispense.quantity.value</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">donGiaSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.donGia <i>&quot;donGia&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: DON_GIA - Đơn giá FHIR path: VNCoreClaim.item[medicationLine].unitPrice.value</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">thanhTienBvSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.thanhTienBv <i>&quot;thanhTienBv&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: THANH_TIEN_BV - Thành tiền bệnh viện FHIR path: VNCoreClaim.item[medicationLine].net.value | VNCoreClaim.item[medicationLine].extension[hospitalLineAmount].valueMoney.value</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">thanhTienBhSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.thanhTienBh <i>&quot;thanhTienBh&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: THANH_TIEN_BH - Thành tiền BHYT FHIR path: VNCoreClaim.item[medicationLine].extension[insuranceCostInfo].extension[insuranceLineAmount].valueMoney.value</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">mucHuongSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.mucHuong <i>&quot;mucHuong&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: MUC_HUONG - Mức hưởng FHIR path: VNCoreClaim.item[medicationLine].extension[insuranceCostInfo].extension[benefitLevel].valueDecimal</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">tBnttSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.tBntt <i>&quot;tBntt&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: T_BNTT - Người bệnh tự trả FHIR path: Derived from VNCoreClaimResponse.item[medicationLine].adjudication.where(category='submitted').amount - .where(category='eligible').amount | Derived from VNCoreExplanationOfBenefit.item[medicationLine].adjudication.where(category='submitted').amount - .where(category='eligible').amount</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">tBncctSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.tBncct <i>&quot;tBncct&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: T_BNCCT - Người bệnh cùng chi trả FHIR path: VNCoreClaimResponse.item[medicationLine].adjudication.where(category='copay').amount.value | VNCoreExplanationOfBenefit.item[medicationLine].adjudication.where(category='copay').amount.value</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">tBhttSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.tBhtt <i>&quot;tBhtt&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: T_BHTT - Quỹ BHYT thanh toán FHIR path: VNCoreClaimResponse.item[medicationLine].adjudication.where(category='benefit').amount.value | VNCoreExplanationOfBenefit.item[medicationLine].adjudication.where(category='benefit').amount.value</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">maKhoaSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.maKhoa <i>&quot;maKhoa&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: MA_KHOA - Mã khoa FHIR path: VNCoreClaim.item[medicationLine].extension[department].valueCodeableConcept.coding.code</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">maBacSiSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.maBacSi <i>&quot;maBacSi&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: MA_BAC_SI - Mã bác sĩ FHIR path: VNCoreMedicationRequest.requester.resolve().identifier.value | VNCorePractitioner.identifier.value</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">maDichVuSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.maDichVu <i>&quot;maDichVu&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: MA_DICH_VU - Mã dịch vụ liên quan FHIR path: VNCoreClaim.item[medicationLine].detail.productOrService.coding.code | VNCoreServiceRequest.code</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">ngayYlSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.ngayYl <i>&quot;ngayYl&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: NGAY_YL - Ngày y lệnh FHIR path: VNCoreMedicationRequest.authoredOn</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">ngayThYlSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.ngayThYl <i>&quot;ngayThYl&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: NGAY_TH_YL - Ngày thực hiện y lệnh FHIR path: VNCoreMedicationDispense.whenHandedOver | VNCoreMedicationDispense.whenPrepared</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">maPtttSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.maPttt <i>&quot;maPttt&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: MA_PTTT - Mã phẫu thuật/thủ thuật liên quan FHIR path: VNCoreClaim.procedure.procedureCodeableConcept | VNCoreProcedure.code Mapping note: Procedure context for medication lines when QD 3176 requires linking the drug to a related surgery/procedure; do not infer this from MA_NHOM.</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">nguonCtraSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.nguonCtra <i>&quot;nguonCtra&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: NGUON_CTRA - Nguồn chi trả FHIR path: VNCoreClaim.item[medicationLine].extension[paymentSource].valueCodeableConcept.coding.code | VNCoreExplanationOfBenefit.item[medicationLine].extension[paymentSource].valueCodeableConcept.coding.code</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">vetThuongTpSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.vetThuongTp <i>&quot;vetThuongTp&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: VET_THUONG_TP - Vết thương tái phát FHIR path: VNCoreClaim.item[medicationLine].extension[recurrentWoundBenefit].valueBoolean | VNCoreExplanationOfBenefit.item[medicationLine].extension[recurrentWoundBenefit].valueBoolean Mapping note: Exporter emits literal `1` only when the line-level recurrentWoundBenefit flag is true; this is not a diagnosis recurrence code.</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span></pre></div>"
  },
  "url" : "http://fhir.hl7.org.vn/core/StructureMap/vn-sm-bhyt-xml2-medication",
  "version" : "0.5.0",
  "name" : "BHYTXML2MedicationLMStructureMap",
  "title" : "Bảng 2 thuốc BHYT — Logical Model — StructureMap",
  "status" : "draft",
  "experimental" : false,
  "date" : "2026-04-28",
  "publisher" : "Omi HealthTech / VN Core FHIR Community Initiative",
  "contact" : [
    {
      "name" : "Omi HealthTech / VN Core FHIR Community Initiative",
      "telecom" : [
        {
          "system" : "url",
          "value" : "https://hl7.org.vn"
        },
        {
          "system" : "email",
          "value" : "[email protected]"
        }
      ]
    },
    {
      "name" : "Omi HealthTech (OmiGroup)",
      "telecom" : [
        {
          "system" : "url",
          "value" : "https://omihealthtech.vn"
        },
        {
          "system" : "url",
          "value" : "https://omigroup.vn"
        },
        {
          "system" : "email",
          "value" : "[email protected]"
        }
      ]
    }
  ],
  "description" : "Generated StructureMap scaffold for Bảng 2 thuốc BHYT — Logical Model. Source semantics come from the logical model mapping annotations in `BHYTXML2MedicationLM.fsh` and remain aligned with the Python BHYT round-trip export adapter.",
  "jurisdiction" : [
    {
      "coding" : [
        {
          "system" : "urn:iso:std:iso:3166",
          "code" : "VN",
          "display" : "Viet Nam"
        }
      ]
    }
  ],
  "purpose" : "Publish canonical, reviewable FHIR-to-BHYT XML mapping artifacts for XML1-XML12 without duplicating field-level mapping semantics across FSH, wiki, and export code.",
  "structure" : [
    {
      "url" : "http://fhir.hl7.org.vn/core/StructureDefinition/vn-core-bhyt-submission-bundle",
      "mode" : "source",
      "alias" : "BHYTSubmissionBundle",
      "documentation" : "FHIR-native source bundle profile used by the repository round-trip adapter."
    },
    {
      "url" : "http://fhir.hl7.org.vn/core/StructureDefinition/bhytXml2MedicationLm",
      "mode" : "target",
      "alias" : "BHYTXML2MedicationLM",
      "documentation" : "Bảng 2 thuốc BHYT — Logical Model"
    }
  ],
  "group" : [
    {
      "name" : "MapBHYTXML2MedicationLM",
      "typeMode" : "none",
      "documentation" : "Full QD 3176 XML2 field catalog. MA_NHOM uses the QD 3176 source code system and must be mapped to QD 697/VNCostCategoryCS with a ConceptMap. Generated from logical-model `^mapping` annotations. Fields still missing a field-level `^mapping.map` entry remain outside this StructureMap and are tracked in `wiki/mappings/bhyt-output-data/machine/structuremap-coverage.json`.",
      "input" : [
        {
          "name" : "sourceBundle",
          "type" : "BHYTSubmissionBundle",
          "mode" : "source",
          "documentation" : "VN Core BHYT submission bundle."
        },
        {
          "name" : "targetRow",
          "type" : "BHYTXML2MedicationLM",
          "mode" : "target",
          "documentation" : "Bảng 2 thuốc BHYT — Logical Model"
        }
      ],
      "rule" : [
        {
          "name" : "maLk",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "maLkSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "maLk"
            }
          ],
          "documentation" : "Target field: MA_LK - Mã liên kết hồ sơ FHIR path: VNCoreClaim.identifier[MALK].value"
        },
        {
          "name" : "stt",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "sttSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "stt"
            }
          ],
          "documentation" : "Target field: STT - Số thứ tự dòng FHIR path: VNCoreClaim.item[medicationLine].sequence"
        },
        {
          "name" : "maThuoc",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "maThuocSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "maThuoc"
            }
          ],
          "documentation" : "Target field: MA_THUOC - Mã thuốc FHIR path: VNCoreMedication.code.coding.code | VNCoreClaim.item[medicationLine].productOrService.coding.code"
        },
        {
          "name" : "maPpChebien",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "maPpChebienSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "maPpChebien"
            }
          ],
          "documentation" : "Target field: MA_PP_CHEBIEN - Mã phương pháp chế biến FHIR path: VNCoreClaim.item[medicationLine].extension[processingMethod].valueString | VNCoreExplanationOfBenefit.item[medicationLine].extension[processingMethod].valueString | VNCoreMedication.extension[processingMethod].valueString | VNCoreMedicationRequest.extension[processingMethod].valueString | VNCoreMedicationDispense.extension[processingMethod].valueString"
        },
        {
          "name" : "maCskcbThuoc",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "maCskcbThuocSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "maCskcbThuoc"
            }
          ],
          "documentation" : "Target field: MA_CSKCB_THUOC - Mã cơ sở KCB cấp thuốc FHIR path: VNCoreMedicationDispense.performer.actor.resolve().identifier[CSKCB].value | VNCoreMedicationDispense.location.resolve().identifier[CSKCB].value"
        },
        {
          "name" : "maNhom",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "maNhomSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "maNhom"
            }
          ],
          "documentation" : "Target field: MA_NHOM - Mã nhóm chi phí theo QĐ 3176 FHIR path: ConceptMap/vn-cm-qd3176-cost-group-to-q697-cost-category -> VNCoreClaim.item[medicationLine].category.coding.code Mapping note: QD 3176 uses MA_NHOM=4 for medication; StructureMap must first apply the ConceptMap, then populate VNCostCategoryCS#8. Do not assign the QD 3176 code directly to VNCostCategoryCS."
        },
        {
          "name" : "tenThuoc",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "tenThuocSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "tenThuoc"
            }
          ],
          "documentation" : "Target field: TEN_THUOC - Tên thuốc FHIR path: VNCoreMedication.code.text | VNCoreClaim.item[medicationLine].productOrService.text | display"
        },
        {
          "name" : "donViTinh",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "donViTinhSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "donViTinh"
            }
          ],
          "documentation" : "Target field: DON_VI_TINH - Đơn vị tính FHIR path: VNCoreClaim.item[medicationLine].quantity.unit"
        },
        {
          "name" : "hamLuong",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "hamLuongSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "hamLuong"
            }
          ],
          "documentation" : "Target field: HAM_LUONG - Hàm lượng FHIR path: VNCoreMedication.ingredient.strength | Medication.code.text"
        },
        {
          "name" : "duongDung",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "duongDungSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "duongDung"
            }
          ],
          "documentation" : "Target field: DUONG_DUNG - Đường dùng FHIR path: VNCoreMedicationRequest.dosageInstruction.route"
        },
        {
          "name" : "dangBaoChe",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "dangBaoCheSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "dangBaoChe"
            }
          ],
          "documentation" : "Target field: DANG_BAO_CHE - Dạng bào chế FHIR path: VNCoreMedication.form.coding.code | VNCoreMedication.form.text"
        },
        {
          "name" : "lieuDung",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "lieuDungSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "lieuDung"
            }
          ],
          "documentation" : "Target field: LIEU_DUNG - Liều dùng FHIR path: VNCoreMedicationRequest.dosageInstruction.doseAndRate"
        },
        {
          "name" : "cachDung",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "cachDungSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "cachDung"
            }
          ],
          "documentation" : "Target field: CACH_DUNG - Cách dùng FHIR path: VNCoreMedicationRequest.dosageInstruction.text"
        },
        {
          "name" : "soDangKy",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "soDangKySource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "soDangKy"
            }
          ],
          "documentation" : "Target field: SO_DANG_KY - Số đăng ký thuốc FHIR path: VNCoreMedication.extension[registrationNumber].valueString | VNCoreMedicationRequest.extension[registrationNumber].valueString | VNCoreMedicationDispense.extension[registrationNumber].valueString"
        },
        {
          "name" : "ttThau",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "ttThauSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "ttThau"
            }
          ],
          "documentation" : "Target field: TT_THAU - Thông tin thầu FHIR path: VNCoreClaim.item[medicationLine].extension[tenderInfo].valueString | VNCoreExplanationOfBenefit.item[medicationLine].extension[tenderInfo].valueString | VNCoreMedication.extension[tenderInfo].valueString | VNCoreMedicationRequest.extension[tenderInfo].valueString | VNCoreMedicationDispense.extension[tenderInfo].valueString"
        },
        {
          "name" : "phamVi",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "phamViSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "phamVi"
            }
          ],
          "documentation" : "Target field: PHAM_VI - Phạm vi thanh toán FHIR path: VNCoreClaim.item[medicationLine].extension[insuranceCostInfo].extension[scope].valueCodeableConcept"
        },
        {
          "name" : "tyleTtBh",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "tyleTtBhSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "tyleTtBh"
            }
          ],
          "documentation" : "Target field: TYLE_TT_BH - Tỷ lệ thanh toán BHYT FHIR path: VNCoreClaim.item[medicationLine].extension[insuranceCostInfo].extension[paymentRatio].valueDecimal"
        },
        {
          "name" : "soLuong",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "soLuongSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "soLuong"
            }
          ],
          "documentation" : "Target field: SO_LUONG - Số lượng FHIR path: VNCoreClaim.item[medicationLine].quantity.value | VNCoreMedicationDispense.quantity.value"
        },
        {
          "name" : "donGia",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "donGiaSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "donGia"
            }
          ],
          "documentation" : "Target field: DON_GIA - Đơn giá FHIR path: VNCoreClaim.item[medicationLine].unitPrice.value"
        },
        {
          "name" : "thanhTienBv",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "thanhTienBvSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "thanhTienBv"
            }
          ],
          "documentation" : "Target field: THANH_TIEN_BV - Thành tiền bệnh viện FHIR path: VNCoreClaim.item[medicationLine].net.value | VNCoreClaim.item[medicationLine].extension[hospitalLineAmount].valueMoney.value"
        },
        {
          "name" : "thanhTienBh",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "thanhTienBhSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "thanhTienBh"
            }
          ],
          "documentation" : "Target field: THANH_TIEN_BH - Thành tiền BHYT FHIR path: VNCoreClaim.item[medicationLine].extension[insuranceCostInfo].extension[insuranceLineAmount].valueMoney.value"
        },
        {
          "name" : "mucHuong",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "mucHuongSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "mucHuong"
            }
          ],
          "documentation" : "Target field: MUC_HUONG - Mức hưởng FHIR path: VNCoreClaim.item[medicationLine].extension[insuranceCostInfo].extension[benefitLevel].valueDecimal"
        },
        {
          "name" : "tBntt",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "tBnttSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "tBntt"
            }
          ],
          "documentation" : "Target field: T_BNTT - Người bệnh tự trả FHIR path: Derived from VNCoreClaimResponse.item[medicationLine].adjudication.where(category='submitted').amount - .where(category='eligible').amount | Derived from VNCoreExplanationOfBenefit.item[medicationLine].adjudication.where(category='submitted').amount - .where(category='eligible').amount"
        },
        {
          "name" : "tBncct",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "tBncctSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "tBncct"
            }
          ],
          "documentation" : "Target field: T_BNCCT - Người bệnh cùng chi trả FHIR path: VNCoreClaimResponse.item[medicationLine].adjudication.where(category='copay').amount.value | VNCoreExplanationOfBenefit.item[medicationLine].adjudication.where(category='copay').amount.value"
        },
        {
          "name" : "tBhtt",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "tBhttSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "tBhtt"
            }
          ],
          "documentation" : "Target field: T_BHTT - Quỹ BHYT thanh toán FHIR path: VNCoreClaimResponse.item[medicationLine].adjudication.where(category='benefit').amount.value | VNCoreExplanationOfBenefit.item[medicationLine].adjudication.where(category='benefit').amount.value"
        },
        {
          "name" : "maKhoa",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "maKhoaSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "maKhoa"
            }
          ],
          "documentation" : "Target field: MA_KHOA - Mã khoa FHIR path: VNCoreClaim.item[medicationLine].extension[department].valueCodeableConcept.coding.code"
        },
        {
          "name" : "maBacSi",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "maBacSiSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "maBacSi"
            }
          ],
          "documentation" : "Target field: MA_BAC_SI - Mã bác sĩ FHIR path: VNCoreMedicationRequest.requester.resolve().identifier.value | VNCorePractitioner.identifier.value"
        },
        {
          "name" : "maDichVu",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "maDichVuSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "maDichVu"
            }
          ],
          "documentation" : "Target field: MA_DICH_VU - Mã dịch vụ liên quan FHIR path: VNCoreClaim.item[medicationLine].detail.productOrService.coding.code | VNCoreServiceRequest.code"
        },
        {
          "name" : "ngayYl",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "ngayYlSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "ngayYl"
            }
          ],
          "documentation" : "Target field: NGAY_YL - Ngày y lệnh FHIR path: VNCoreMedicationRequest.authoredOn"
        },
        {
          "name" : "ngayThYl",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "ngayThYlSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "ngayThYl"
            }
          ],
          "documentation" : "Target field: NGAY_TH_YL - Ngày thực hiện y lệnh FHIR path: VNCoreMedicationDispense.whenHandedOver | VNCoreMedicationDispense.whenPrepared"
        },
        {
          "name" : "maPttt",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "maPtttSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "maPttt"
            }
          ],
          "documentation" : "Target field: MA_PTTT - Mã phẫu thuật/thủ thuật liên quan FHIR path: VNCoreClaim.procedure.procedureCodeableConcept | VNCoreProcedure.code Mapping note: Procedure context for medication lines when QD 3176 requires linking the drug to a related surgery/procedure; do not infer this from MA_NHOM."
        },
        {
          "name" : "nguonCtra",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "nguonCtraSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "nguonCtra"
            }
          ],
          "documentation" : "Target field: NGUON_CTRA - Nguồn chi trả FHIR path: VNCoreClaim.item[medicationLine].extension[paymentSource].valueCodeableConcept.coding.code | VNCoreExplanationOfBenefit.item[medicationLine].extension[paymentSource].valueCodeableConcept.coding.code"
        },
        {
          "name" : "vetThuongTp",
          "source" : [
            {
              "context" : "sourceBundle",
              "min" : 0,
              "max" : "*",
              "element" : "entry",
              "variable" : "vetThuongTpSource"
            }
          ],
          "target" : [
            {
              "context" : "targetRow",
              "contextType" : "variable",
              "element" : "vetThuongTp"
            }
          ],
          "documentation" : "Target field: VET_THUONG_TP - Vết thương tái phát FHIR path: VNCoreClaim.item[medicationLine].extension[recurrentWoundBenefit].valueBoolean | VNCoreExplanationOfBenefit.item[medicationLine].extension[recurrentWoundBenefit].valueBoolean Mapping note: Exporter emits literal `1` only when the line-level recurrentWoundBenefit flag is true; this is not a diagnosis recurrence code."
        }
      ]
    }
  ]
}