{
  "resourceType" : "StructureMap",
  "id" : "vn-sm-bhyt-xml3-service",
  "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-xml3-service</b></p><a name=\"vn-sm-bhyt-xml3-service\"> </a><a name=\"hcvn-sm-bhyt-xml3-service\"> </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-xml3-service<span style=\"color: navy\">&quot; = &quot;</span>BHYTXML3ServiceLMStructureMap<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 3 DVKT và vật tư BHYT — Logical Model. Source semantics come from the logical model mapping annotations in `BHYTXML3ServiceLM.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-bhytXml3ServiceLm.html\" title=\"Bảng 3 DVKT và vật tư BHYT — Logical Model\">http://fhir.hl7.org.vn/core/StructureDefinition/bhytXml3ServiceLm</a><span style=\"color: navy\">&quot; </span><b>alias </b>BHYTXML3ServiceLM <b>as </b><b>target</b> <span style=\"color: navy\">// </span><span style=\"color: green\">Bảng 3 DVKT và vật tư BHYT — Logical Model</span>\r\n\r\n<span style=\"color: navy\">// </span><span style=\"color: green\">Full QD 3176 XML3 field catalog. Rows are derived from non-medication service, supply, device, procedure, and bed-day claim items. 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>MapBHYTXML3ServiceLM<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>BHYTXML3ServiceLM<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.where(category!='8').sequence</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ụ kỹ thuật FHIR path: VNCoreClaim.item.where(category!='8').productOrService.coding.code | VNCoreServiceRequest.code.coding.code Mapping note: Conditionally required when MA_VAT_TU is absent or MA_NHOM is not 10.</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">maPtttQtSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.maPtttQt <i>&quot;maPtttQt&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: MA_PTTT_QT - Mã phương thức thanh toán FHIR path: VNCoreClaim.extension[paymentMethod].valueCodeableConcept.coding.code | VNCoreClaim.item.extension[paymentMethod].valueCodeableConcept.coding.code</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">maVatTuSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.maVatTu <i>&quot;maVatTu&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: MA_VAT_TU - Mã vật tư y tế FHIR path: VNCoreDevice.identifier[medicalDeviceItemCode].value | VNCoreClaim.item.where(category!='8').productOrService.coding.code Mapping note: Conditionally required when MA_DICH_VU is absent or MA_NHOM=10; do not collapse medical supplies into service codes when Device is available.</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.where(category!='8').category.coding.code Mapping note: Source code system is QD 3176 MA_NHOM. Export/import must bridge through the ConceptMap instead of assigning the QD 697 target code directly.</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">tenVatTuSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.tenVatTu <i>&quot;tenVatTu&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: TEN_VAT_TU - Tên vật tư y tế FHIR path: VNCoreDevice.deviceName.name | VNCoreClaim.item.where(category!='8').productOrService.text | display</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">tenDichVuSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.tenDichVu <i>&quot;tenDichVu&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: TEN_DICH_VU - Tên dịch vụ kỹ thuật FHIR path: VNCoreClaim.item.where(category!='8').productOrService.text | VNCoreServiceRequest.code.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.where(category!='8').quantity.unit</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.where(category!='8').extension[insuranceCostInfo].extension[scope].valueCodeableConcept</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.where(category!='8').quantity.value</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">donGiaBvSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.donGiaBv <i>&quot;donGiaBv&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: DON_GIA_BV - Đơn giá bệnh viện FHIR path: VNCoreClaim.item.where(category!='8').unitPrice.value | VNCoreClaim.item.extension[hospitalUnitPrice].valueMoney.value Mapping note: Hospital charge price; keep separate from the BHYT price to avoid financial round-trip loss.</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">donGiaBhSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.donGiaBh <i>&quot;donGiaBh&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: DON_GIA_BH - Đơn giá BHYT FHIR path: VNCoreClaim.item.where(category!='8').extension[insuranceCostInfo].extension[insuranceUnitPrice].valueMoney.value Mapping note: BHYT-covered unit price; do not collapse into Claim.item.unitPrice when hospital and insurance prices differ.</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">tyleTtDvSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.tyleTtDv <i>&quot;tyleTtDv&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: TYLE_TT_DV - Tỷ lệ thanh toán dịch vụ FHIR path: VNCoreClaim.item.where(category!='8').extension[insuranceCostInfo].extension[servicePaymentRatio].valueDecimal</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.where(category!='8').extension[insuranceCostInfo].extension[paymentRatio].valueDecimal</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.where(category!='8').net.value | VNCoreClaim.item.extension[hospitalLineAmount].valueMoney.value Mapping note: Hospital line amount; keep separate from BHYT line amount.</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.where(category!='8').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.where(category!='8').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[serviceLine].adjudication.where(category='submitted').amount - .where(category='eligible').amount | Derived from VNCoreExplanationOfBenefit.item[serviceLine].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[serviceLine].adjudication.where(category='copay').amount.value | VNCoreExplanationOfBenefit.item[serviceLine].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[serviceLine].adjudication.where(category='benefit').amount.value | VNCoreExplanationOfBenefit.item[serviceLine].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.where(category!='8').extension[department].valueCodeableConcept.coding.code</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">maGiuongSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.maGiuong <i>&quot;maGiuong&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: MA_GIUONG - Mã giường FHIR path: VNCoreEncounter.location.location.resolve().identifier.value Mapping note: Conditionally required for bed-day MA_NHOM values 14, 15, 16.</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: VNCoreServiceRequest.requester.resolve().identifier.value | VNCoreProcedure.performer.actor.resolve().identifier.value | VNCorePractitioner.identifier.value</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">nguoiThucHienSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.nguoiThucHien <i>&quot;nguoiThucHien&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: NGUOI_THUC_HIEN - Người thực hiện FHIR path: VNCoreProcedure.performer.actor.resolve().identifier.value | VNCorePractitioner.identifier.value</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">maBenhSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.maBenh <i>&quot;maBenh&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: MA_BENH - Mã bệnh liên quan FHIR path: VNCoreCondition.code | VNCoreClaim.diagnosis.diagnosisCodeableConcept</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">maBenhYhctSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.maBenhYhct <i>&quot;maBenhYhct&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: MA_BENH_YHCT - Mã bệnh y học cổ truyền FHIR path: VNCoreClaim.diagnosis.diagnosisCodeableConcept.coding[yhct].code | VNCoreCondition.code.coding[yhct].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: VNCoreServiceRequest.authoredOn | VNCoreProcedure.basedOn.resolve().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: VNCoreProcedure.performedDateTime | VNCoreServiceRequest.occurrenceDateTime</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">ngayKqSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.ngayKq <i>&quot;ngayKq&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: NGAY_KQ - Ngày kết quả FHIR path: VNCoreDiagnosticReport.issued | VNCoreObservationLab.effectiveDateTime Mapping note: Conditionally required except for bed-day MA_NHOM values 14, 15, 16.</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 FHIR path: VNCoreClaim.procedure.procedureCodeableConcept | VNCoreProcedure.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[serviceLine].extension[recurrentWoundBenefit].valueBoolean | VNCoreExplanationOfBenefit.item[serviceLine].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  sourceBundle.entry<b> as </b><span style=\"color: maroon\">viTriThDvktSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.viTriThDvkt <i>&quot;viTriThDvkt&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: VI_TRI_TH_DVKT - Vị trí thực hiện DVKT FHIR path: VNCoreProcedure.bodySite | VNCoreServiceRequest.bodySite</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">maMaySource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.maMay <i>&quot;maMay&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: MA_MAY - Mã máy FHIR path: VNCoreDevice.identifier.value</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">maHieuSpSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.maHieuSp <i>&quot;maHieuSp&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: MA_HIEU_SP - Mã hiệu sản phẩm FHIR path: VNCoreDevice.deviceName.name | VNCoreDevice.modelNumber</span>\r\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">taiSuDungSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.taiSuDung <i>&quot;taiSuDung&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: TAI_SU_DUNG - Tái sử dụng FHIR path: VNCoreDeviceUseStatement.note | future reusable-device extension</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-xml3-service",
  "version" : "0.5.0",
  "name" : "BHYTXML3ServiceLMStructureMap",
  "title" : "Bảng 3 DVKT và vật tư 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" : "info@hl7.org.vn"
    }]
  },
  {
    "name" : "Omi HealthTech (OmiGroup)",
    "telecom" : [{
      "system" : "url",
      "value" : "https://omihealthtech.vn"
    },
    {
      "system" : "url",
      "value" : "https://omigroup.vn"
    },
    {
      "system" : "email",
      "value" : "healthtech@omigroup.vn"
    }]
  }],
  "description" : "Generated StructureMap scaffold for Bảng 3 DVKT và vật tư BHYT — Logical Model. Source semantics come from the logical model mapping annotations in `BHYTXML3ServiceLM.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/bhytXml3ServiceLm",
    "mode" : "target",
    "alias" : "BHYTXML3ServiceLM",
    "documentation" : "Bảng 3 DVKT và vật tư BHYT — Logical Model"
  }],
  "group" : [{
    "name" : "MapBHYTXML3ServiceLM",
    "typeMode" : "none",
    "documentation" : "Full QD 3176 XML3 field catalog. Rows are derived from non-medication service, supply, device, procedure, and bed-day claim items. 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" : "BHYTXML3ServiceLM",
      "mode" : "target",
      "documentation" : "Bảng 3 DVKT và vật tư 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.where(category!='8').sequence"
    },
    {
      "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ụ kỹ thuật FHIR path: VNCoreClaim.item.where(category!='8').productOrService.coding.code | VNCoreServiceRequest.code.coding.code Mapping note: Conditionally required when MA_VAT_TU is absent or MA_NHOM is not 10."
    },
    {
      "name" : "maPtttQt",
      "source" : [{
        "context" : "sourceBundle",
        "min" : 0,
        "max" : "*",
        "element" : "entry",
        "variable" : "maPtttQtSource"
      }],
      "target" : [{
        "context" : "targetRow",
        "contextType" : "variable",
        "element" : "maPtttQt"
      }],
      "documentation" : "Target field: MA_PTTT_QT - Mã phương thức thanh toán FHIR path: VNCoreClaim.extension[paymentMethod].valueCodeableConcept.coding.code | VNCoreClaim.item.extension[paymentMethod].valueCodeableConcept.coding.code"
    },
    {
      "name" : "maVatTu",
      "source" : [{
        "context" : "sourceBundle",
        "min" : 0,
        "max" : "*",
        "element" : "entry",
        "variable" : "maVatTuSource"
      }],
      "target" : [{
        "context" : "targetRow",
        "contextType" : "variable",
        "element" : "maVatTu"
      }],
      "documentation" : "Target field: MA_VAT_TU - Mã vật tư y tế FHIR path: VNCoreDevice.identifier[medicalDeviceItemCode].value | VNCoreClaim.item.where(category!='8').productOrService.coding.code Mapping note: Conditionally required when MA_DICH_VU is absent or MA_NHOM=10; do not collapse medical supplies into service codes when Device is available."
    },
    {
      "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.where(category!='8').category.coding.code Mapping note: Source code system is QD 3176 MA_NHOM. Export/import must bridge through the ConceptMap instead of assigning the QD 697 target code directly."
    },
    {
      "name" : "tenVatTu",
      "source" : [{
        "context" : "sourceBundle",
        "min" : 0,
        "max" : "*",
        "element" : "entry",
        "variable" : "tenVatTuSource"
      }],
      "target" : [{
        "context" : "targetRow",
        "contextType" : "variable",
        "element" : "tenVatTu"
      }],
      "documentation" : "Target field: TEN_VAT_TU - Tên vật tư y tế FHIR path: VNCoreDevice.deviceName.name | VNCoreClaim.item.where(category!='8').productOrService.text | display"
    },
    {
      "name" : "tenDichVu",
      "source" : [{
        "context" : "sourceBundle",
        "min" : 0,
        "max" : "*",
        "element" : "entry",
        "variable" : "tenDichVuSource"
      }],
      "target" : [{
        "context" : "targetRow",
        "contextType" : "variable",
        "element" : "tenDichVu"
      }],
      "documentation" : "Target field: TEN_DICH_VU - Tên dịch vụ kỹ thuật FHIR path: VNCoreClaim.item.where(category!='8').productOrService.text | VNCoreServiceRequest.code.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.where(category!='8').quantity.unit"
    },
    {
      "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.where(category!='8').extension[insuranceCostInfo].extension[scope].valueCodeableConcept"
    },
    {
      "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.where(category!='8').quantity.value"
    },
    {
      "name" : "donGiaBv",
      "source" : [{
        "context" : "sourceBundle",
        "min" : 0,
        "max" : "*",
        "element" : "entry",
        "variable" : "donGiaBvSource"
      }],
      "target" : [{
        "context" : "targetRow",
        "contextType" : "variable",
        "element" : "donGiaBv"
      }],
      "documentation" : "Target field: DON_GIA_BV - Đơn giá bệnh viện FHIR path: VNCoreClaim.item.where(category!='8').unitPrice.value | VNCoreClaim.item.extension[hospitalUnitPrice].valueMoney.value Mapping note: Hospital charge price; keep separate from the BHYT price to avoid financial round-trip loss."
    },
    {
      "name" : "donGiaBh",
      "source" : [{
        "context" : "sourceBundle",
        "min" : 0,
        "max" : "*",
        "element" : "entry",
        "variable" : "donGiaBhSource"
      }],
      "target" : [{
        "context" : "targetRow",
        "contextType" : "variable",
        "element" : "donGiaBh"
      }],
      "documentation" : "Target field: DON_GIA_BH - Đơn giá BHYT FHIR path: VNCoreClaim.item.where(category!='8').extension[insuranceCostInfo].extension[insuranceUnitPrice].valueMoney.value Mapping note: BHYT-covered unit price; do not collapse into Claim.item.unitPrice when hospital and insurance prices differ."
    },
    {
      "name" : "tyleTtDv",
      "source" : [{
        "context" : "sourceBundle",
        "min" : 0,
        "max" : "*",
        "element" : "entry",
        "variable" : "tyleTtDvSource"
      }],
      "target" : [{
        "context" : "targetRow",
        "contextType" : "variable",
        "element" : "tyleTtDv"
      }],
      "documentation" : "Target field: TYLE_TT_DV - Tỷ lệ thanh toán dịch vụ FHIR path: VNCoreClaim.item.where(category!='8').extension[insuranceCostInfo].extension[servicePaymentRatio].valueDecimal"
    },
    {
      "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.where(category!='8').extension[insuranceCostInfo].extension[paymentRatio].valueDecimal"
    },
    {
      "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.where(category!='8').net.value | VNCoreClaim.item.extension[hospitalLineAmount].valueMoney.value Mapping note: Hospital line amount; keep separate from BHYT line amount."
    },
    {
      "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.where(category!='8').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.where(category!='8').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[serviceLine].adjudication.where(category='submitted').amount - .where(category='eligible').amount | Derived from VNCoreExplanationOfBenefit.item[serviceLine].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[serviceLine].adjudication.where(category='copay').amount.value | VNCoreExplanationOfBenefit.item[serviceLine].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[serviceLine].adjudication.where(category='benefit').amount.value | VNCoreExplanationOfBenefit.item[serviceLine].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.where(category!='8').extension[department].valueCodeableConcept.coding.code"
    },
    {
      "name" : "maGiuong",
      "source" : [{
        "context" : "sourceBundle",
        "min" : 0,
        "max" : "*",
        "element" : "entry",
        "variable" : "maGiuongSource"
      }],
      "target" : [{
        "context" : "targetRow",
        "contextType" : "variable",
        "element" : "maGiuong"
      }],
      "documentation" : "Target field: MA_GIUONG - Mã giường FHIR path: VNCoreEncounter.location.location.resolve().identifier.value Mapping note: Conditionally required for bed-day MA_NHOM values 14, 15, 16."
    },
    {
      "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: VNCoreServiceRequest.requester.resolve().identifier.value | VNCoreProcedure.performer.actor.resolve().identifier.value | VNCorePractitioner.identifier.value"
    },
    {
      "name" : "nguoiThucHien",
      "source" : [{
        "context" : "sourceBundle",
        "min" : 0,
        "max" : "*",
        "element" : "entry",
        "variable" : "nguoiThucHienSource"
      }],
      "target" : [{
        "context" : "targetRow",
        "contextType" : "variable",
        "element" : "nguoiThucHien"
      }],
      "documentation" : "Target field: NGUOI_THUC_HIEN - Người thực hiện FHIR path: VNCoreProcedure.performer.actor.resolve().identifier.value | VNCorePractitioner.identifier.value"
    },
    {
      "name" : "maBenh",
      "source" : [{
        "context" : "sourceBundle",
        "min" : 0,
        "max" : "*",
        "element" : "entry",
        "variable" : "maBenhSource"
      }],
      "target" : [{
        "context" : "targetRow",
        "contextType" : "variable",
        "element" : "maBenh"
      }],
      "documentation" : "Target field: MA_BENH - Mã bệnh liên quan FHIR path: VNCoreCondition.code | VNCoreClaim.diagnosis.diagnosisCodeableConcept"
    },
    {
      "name" : "maBenhYhct",
      "source" : [{
        "context" : "sourceBundle",
        "min" : 0,
        "max" : "*",
        "element" : "entry",
        "variable" : "maBenhYhctSource"
      }],
      "target" : [{
        "context" : "targetRow",
        "contextType" : "variable",
        "element" : "maBenhYhct"
      }],
      "documentation" : "Target field: MA_BENH_YHCT - Mã bệnh y học cổ truyền FHIR path: VNCoreClaim.diagnosis.diagnosisCodeableConcept.coding[yhct].code | VNCoreCondition.code.coding[yhct].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: VNCoreServiceRequest.authoredOn | VNCoreProcedure.basedOn.resolve().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: VNCoreProcedure.performedDateTime | VNCoreServiceRequest.occurrenceDateTime"
    },
    {
      "name" : "ngayKq",
      "source" : [{
        "context" : "sourceBundle",
        "min" : 0,
        "max" : "*",
        "element" : "entry",
        "variable" : "ngayKqSource"
      }],
      "target" : [{
        "context" : "targetRow",
        "contextType" : "variable",
        "element" : "ngayKq"
      }],
      "documentation" : "Target field: NGAY_KQ - Ngày kết quả FHIR path: VNCoreDiagnosticReport.issued | VNCoreObservationLab.effectiveDateTime Mapping note: Conditionally required except for bed-day MA_NHOM values 14, 15, 16."
    },
    {
      "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 FHIR path: VNCoreClaim.procedure.procedureCodeableConcept | VNCoreProcedure.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[serviceLine].extension[recurrentWoundBenefit].valueBoolean | VNCoreExplanationOfBenefit.item[serviceLine].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."
    },
    {
      "name" : "viTriThDvkt",
      "source" : [{
        "context" : "sourceBundle",
        "min" : 0,
        "max" : "*",
        "element" : "entry",
        "variable" : "viTriThDvktSource"
      }],
      "target" : [{
        "context" : "targetRow",
        "contextType" : "variable",
        "element" : "viTriThDvkt"
      }],
      "documentation" : "Target field: VI_TRI_TH_DVKT - Vị trí thực hiện DVKT FHIR path: VNCoreProcedure.bodySite | VNCoreServiceRequest.bodySite"
    },
    {
      "name" : "maMay",
      "source" : [{
        "context" : "sourceBundle",
        "min" : 0,
        "max" : "*",
        "element" : "entry",
        "variable" : "maMaySource"
      }],
      "target" : [{
        "context" : "targetRow",
        "contextType" : "variable",
        "element" : "maMay"
      }],
      "documentation" : "Target field: MA_MAY - Mã máy FHIR path: VNCoreDevice.identifier.value"
    },
    {
      "name" : "maHieuSp",
      "source" : [{
        "context" : "sourceBundle",
        "min" : 0,
        "max" : "*",
        "element" : "entry",
        "variable" : "maHieuSpSource"
      }],
      "target" : [{
        "context" : "targetRow",
        "contextType" : "variable",
        "element" : "maHieuSp"
      }],
      "documentation" : "Target field: MA_HIEU_SP - Mã hiệu sản phẩm FHIR path: VNCoreDevice.deviceName.name | VNCoreDevice.modelNumber"
    },
    {
      "name" : "taiSuDung",
      "source" : [{
        "context" : "sourceBundle",
        "min" : 0,
        "max" : "*",
        "element" : "entry",
        "variable" : "taiSuDungSource"
      }],
      "target" : [{
        "context" : "targetRow",
        "contextType" : "variable",
        "element" : "taiSuDung"
      }],
      "documentation" : "Target field: TAI_SU_DUNG - Tái sử dụng FHIR path: VNCoreDeviceUseStatement.note | future reusable-device extension"
    }]
  }]
}