<?xml version="1.0" encoding="UTF-8"?>

<StructureMap xmlns="http://hl7.org/fhir">
  <id value="vn-sm-bhyt-xml10-maternity-leave"/>
  <language value="vi"/>
  <text>
    <status value="generated"/><div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: StructureMap vn-sm-bhyt-xml10-maternity-leave</b></p><a name="vn-sm-bhyt-xml10-maternity-leave"> </a><a name="hcvn-sm-bhyt-xml10-maternity-leave"> </a><pre class="fml">
<b>map</b><span style="color: navy"> &quot;</span>http://fhir.hl7.org.vn/core/StructureMap/vn-sm-bhyt-xml10-maternity-leave<span style="color: navy">&quot; = &quot;</span>BHYTXML10MaternityLeaveLMStructureMap<span style="color: navy">&quot;

</span><span style="color: navy">// </span><span style="color: green">Generated StructureMap scaffold for Bảng 10 giấy chứng nhận nghỉ dưỡng thai — XML10 Maternity Leave Logical Model. Source semantics come from the logical model mapping annotations in `BHYTXML10MaternityLeaveLM.fsh` and remain aligned with the Python BHYT round-trip export adapter.</span>

<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>
<b>uses</b><span style="color: navy"> &quot;</span><a href="StructureDefinition-bhytXml10MaternityLeaveLm.html" title="Bảng 10 giấy chứng nhận nghỉ dưỡng thai — XML10 Maternity Leave Logical Model">http://fhir.hl7.org.vn/core/StructureDefinition/bhytXml10MaternityLeaveLm</a><span style="color: navy">&quot; </span><b>alias </b>BHYTXML10MaternityLeaveLM <b>as </b><b>target</b> <span style="color: navy">// </span><span style="color: green">Bảng 10 giấy chứng nhận nghỉ dưỡng thai — XML10 Maternity Leave Logical Model</span>

<span style="color: navy">// </span><span style="color: green">Rows are derived from maternity-leave DocumentReference/Composition, period, certifying Practitioner and Organization. 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>
<b>group </b>MapBHYTXML10MaternityLeaveLM<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>BHYTXML10MaternityLeaveLM<span style="color: navy">)</span><span style="color: navy"> {
</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>
  sourceBundle.entry<b> as </b><span style="color: maroon">soSeriSource</span><span style="color: navy"><b> -&gt; </b></span>targetRow.soSeri <i>&quot;soSeri&quot;</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">Target field: SO_SERI - Số seri FHIR path: VNCoreDocumentReference.identifier.value | VNCoreComposition.identifier.value</span>
  sourceBundle.entry<b> as </b><span style="color: maroon">soCtSource</span><span style="color: navy"><b> -&gt; </b></span>targetRow.soCt <i>&quot;soCt&quot;</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">Target field: SO_CT - Số chứng từ FHIR path: VNCoreDocumentReference.identifier.value | VNCoreComposition.identifier.value</span>
  sourceBundle.entry<b> as </b><span style="color: maroon">soNgaySource</span><span style="color: navy"><b> -&gt; </b></span>targetRow.soNgay <i>&quot;soNgay&quot;</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">Target field: SO_NGAY - Số ngày FHIR path: Derived from VNCoreDocumentReference.context.period | VNCoreComposition.event.period</span>
  sourceBundle.entry<b> as </b><span style="color: maroon">donViSource</span><span style="color: navy"><b> -&gt; </b></span>targetRow.donVi <i>&quot;donVi&quot;</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">Target field: DON_VI - Đơn vị FHIR path: VNCoreOrganization.name | VNCoreDocumentReference.custodian.resolve().name</span>
  sourceBundle.entry<b> as </b><span style="color: maroon">tuNgaySource</span><span style="color: navy"><b> -&gt; </b></span>targetRow.tuNgay <i>&quot;tuNgay&quot;</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">Target field: TU_NGAY - Từ ngày FHIR path: VNCoreDocumentReference.context.period.start</span>
  sourceBundle.entry<b> as </b><span style="color: maroon">denNgaySource</span><span style="color: navy"><b> -&gt; </b></span>targetRow.denNgay <i>&quot;denNgay&quot;</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">Target field: DEN_NGAY - Đến ngày FHIR path: VNCoreDocumentReference.context.period.end</span>
  sourceBundle.entry<b> as </b><span style="color: maroon">maTtdvSource</span><span style="color: navy"><b> -&gt; </b></span>targetRow.maTtdv <i>&quot;maTtdv&quot;</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">Target field: MA_TTDV - Mã thủ trưởng đơn vị/người ký FHIR path: VNCoreComposition.attester.party.resolve().identifier.value | VNCoreDocumentReference.authenticator.resolve().identifier.value</span>
  sourceBundle.entry<b> as </b><span style="color: maroon">tenBsSource</span><span style="color: navy"><b> -&gt; </b></span>targetRow.tenBs <i>&quot;tenBs&quot;</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">Target field: TEN_BS - Tên bác sĩ FHIR path: VNCoreComposition.author.display | VNCorePractitioner.name.text</span>
  sourceBundle.entry<b> as </b><span style="color: maroon">maBsSource</span><span style="color: navy"><b> -&gt; </b></span>targetRow.maBs <i>&quot;maBs&quot;</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">Target field: MA_BS - Mã bác sĩ FHIR path: VNCoreComposition.author.resolve().identifier.value | VNCorePractitioner.identifier.value</span>
  sourceBundle.entry<b> as </b><span style="color: maroon">ngayCtSource</span><span style="color: navy"><b> -&gt; </b></span>targetRow.ngayCt <i>&quot;ngayCt&quot;</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">Target field: NGAY_CT - Ngày cấp chứng từ FHIR path: VNCoreDocumentReference.date | VNCoreComposition.date</span>
<span style="color: navy">}

</span></pre></div>
  </text>
  <url value="http://fhir.hl7.org.vn/core/StructureMap/vn-sm-bhyt-xml10-maternity-leave"/>
  <version value="0.5.0"/>
  <name value="BHYTXML10MaternityLeaveLMStructureMap"/>
  <title value="Bảng 10 giấy chứng nhận nghỉ dưỡng thai — XML10 Maternity Leave Logical Model — StructureMap"/>
  <status value="draft"/>
  <experimental value="false"/>
  <date value="2026-04-28"/>
  <publisher value="Omi HealthTech / VN Core FHIR Community Initiative"/>
  <contact>
    <name value="Omi HealthTech / VN Core FHIR Community Initiative"/>
    <telecom>
      <system value="url"/>
      <value value="https://hl7.org.vn"/>
    </telecom>
    <telecom>
      <system value="email"/>
      <value value="info@hl7.org.vn"/>
    </telecom>
  </contact>
  <contact>
    <name value="Omi HealthTech (OmiGroup)"/>
    <telecom>
      <system value="url"/>
      <value value="https://omihealthtech.vn"/>
    </telecom>
    <telecom>
      <system value="url"/>
      <value value="https://omigroup.vn"/>
    </telecom>
    <telecom>
      <system value="email"/>
      <value value="healthtech@omigroup.vn"/>
    </telecom>
  </contact>
  <description value="Generated StructureMap scaffold for Bảng 10 giấy chứng nhận nghỉ dưỡng thai — XML10 Maternity Leave Logical Model. Source semantics come from the logical model mapping annotations in `BHYTXML10MaternityLeaveLM.fsh` and remain aligned with the Python BHYT round-trip export adapter."/>
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166"/>
      <code value="VN"/>
      <display value="Viet Nam"/>
    </coding>
  </jurisdiction>
  <purpose value="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 value="http://fhir.hl7.org.vn/core/StructureDefinition/vn-core-bhyt-submission-bundle"/>
    <mode value="source"/>
    <alias value="BHYTSubmissionBundle"/>
    <documentation value="FHIR-native source bundle profile used by the repository round-trip adapter."/>
  </structure>
  <structure>
    <url value="http://fhir.hl7.org.vn/core/StructureDefinition/bhytXml10MaternityLeaveLm"/>
    <mode value="target"/>
    <alias value="BHYTXML10MaternityLeaveLM"/>
    <documentation value="Bảng 10 giấy chứng nhận nghỉ dưỡng thai — XML10 Maternity Leave Logical Model"/>
  </structure>
  <group>
    <name value="MapBHYTXML10MaternityLeaveLM"/>
    <typeMode value="none"/>
    <documentation value="Rows are derived from maternity-leave DocumentReference/Composition, period, certifying Practitioner and Organization. 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 value="sourceBundle"/>
      <type value="BHYTSubmissionBundle"/>
      <mode value="source"/>
      <documentation value="VN Core BHYT submission bundle."/>
    </input>
    <input>
      <name value="targetRow"/>
      <type value="BHYTXML10MaternityLeaveLM"/>
      <mode value="target"/>
      <documentation value="Bảng 10 giấy chứng nhận nghỉ dưỡng thai — XML10 Maternity Leave Logical Model"/>
    </input>
    <rule>
      <name value="maLk"/>
      <source>
        <context value="sourceBundle"/>
        <min value="0"/>
        <max value="*"/>
        <element value="entry"/>
        <variable value="maLkSource"/>
      </source>
      <target>
        <context value="targetRow"/>
        <contextType value="variable"/>
        <element value="maLk"/>
      </target>
      <documentation value="Target field: MA_LK - Mã liên kết hồ sơ FHIR path: VNCoreClaim.identifier[MALK].value"/>
    </rule>
    <rule>
      <name value="soSeri"/>
      <source>
        <context value="sourceBundle"/>
        <min value="0"/>
        <max value="*"/>
        <element value="entry"/>
        <variable value="soSeriSource"/>
      </source>
      <target>
        <context value="targetRow"/>
        <contextType value="variable"/>
        <element value="soSeri"/>
      </target>
      <documentation value="Target field: SO_SERI - Số seri FHIR path: VNCoreDocumentReference.identifier.value | VNCoreComposition.identifier.value"/>
    </rule>
    <rule>
      <name value="soCt"/>
      <source>
        <context value="sourceBundle"/>
        <min value="0"/>
        <max value="*"/>
        <element value="entry"/>
        <variable value="soCtSource"/>
      </source>
      <target>
        <context value="targetRow"/>
        <contextType value="variable"/>
        <element value="soCt"/>
      </target>
      <documentation value="Target field: SO_CT - Số chứng từ FHIR path: VNCoreDocumentReference.identifier.value | VNCoreComposition.identifier.value"/>
    </rule>
    <rule>
      <name value="soNgay"/>
      <source>
        <context value="sourceBundle"/>
        <min value="0"/>
        <max value="*"/>
        <element value="entry"/>
        <variable value="soNgaySource"/>
      </source>
      <target>
        <context value="targetRow"/>
        <contextType value="variable"/>
        <element value="soNgay"/>
      </target>
      <documentation value="Target field: SO_NGAY - Số ngày FHIR path: Derived from VNCoreDocumentReference.context.period | VNCoreComposition.event.period"/>
    </rule>
    <rule>
      <name value="donVi"/>
      <source>
        <context value="sourceBundle"/>
        <min value="0"/>
        <max value="*"/>
        <element value="entry"/>
        <variable value="donViSource"/>
      </source>
      <target>
        <context value="targetRow"/>
        <contextType value="variable"/>
        <element value="donVi"/>
      </target>
      <documentation value="Target field: DON_VI - Đơn vị FHIR path: VNCoreOrganization.name | VNCoreDocumentReference.custodian.resolve().name"/>
    </rule>
    <rule>
      <name value="tuNgay"/>
      <source>
        <context value="sourceBundle"/>
        <min value="0"/>
        <max value="*"/>
        <element value="entry"/>
        <variable value="tuNgaySource"/>
      </source>
      <target>
        <context value="targetRow"/>
        <contextType value="variable"/>
        <element value="tuNgay"/>
      </target>
      <documentation value="Target field: TU_NGAY - Từ ngày FHIR path: VNCoreDocumentReference.context.period.start"/>
    </rule>
    <rule>
      <name value="denNgay"/>
      <source>
        <context value="sourceBundle"/>
        <min value="0"/>
        <max value="*"/>
        <element value="entry"/>
        <variable value="denNgaySource"/>
      </source>
      <target>
        <context value="targetRow"/>
        <contextType value="variable"/>
        <element value="denNgay"/>
      </target>
      <documentation value="Target field: DEN_NGAY - Đến ngày FHIR path: VNCoreDocumentReference.context.period.end"/>
    </rule>
    <rule>
      <name value="maTtdv"/>
      <source>
        <context value="sourceBundle"/>
        <min value="0"/>
        <max value="*"/>
        <element value="entry"/>
        <variable value="maTtdvSource"/>
      </source>
      <target>
        <context value="targetRow"/>
        <contextType value="variable"/>
        <element value="maTtdv"/>
      </target>
      <documentation value="Target field: MA_TTDV - Mã thủ trưởng đơn vị/người ký FHIR path: VNCoreComposition.attester.party.resolve().identifier.value | VNCoreDocumentReference.authenticator.resolve().identifier.value"/>
    </rule>
    <rule>
      <name value="tenBs"/>
      <source>
        <context value="sourceBundle"/>
        <min value="0"/>
        <max value="*"/>
        <element value="entry"/>
        <variable value="tenBsSource"/>
      </source>
      <target>
        <context value="targetRow"/>
        <contextType value="variable"/>
        <element value="tenBs"/>
      </target>
      <documentation value="Target field: TEN_BS - Tên bác sĩ FHIR path: VNCoreComposition.author.display | VNCorePractitioner.name.text"/>
    </rule>
    <rule>
      <name value="maBs"/>
      <source>
        <context value="sourceBundle"/>
        <min value="0"/>
        <max value="*"/>
        <element value="entry"/>
        <variable value="maBsSource"/>
      </source>
      <target>
        <context value="targetRow"/>
        <contextType value="variable"/>
        <element value="maBs"/>
      </target>
      <documentation value="Target field: MA_BS - Mã bác sĩ FHIR path: VNCoreComposition.author.resolve().identifier.value | VNCorePractitioner.identifier.value"/>
    </rule>
    <rule>
      <name value="ngayCt"/>
      <source>
        <context value="sourceBundle"/>
        <min value="0"/>
        <max value="*"/>
        <element value="entry"/>
        <variable value="ngayCtSource"/>
      </source>
      <target>
        <context value="targetRow"/>
        <contextType value="variable"/>
        <element value="ngayCt"/>
      </target>
      <documentation value="Target field: NGAY_CT - Ngày cấp chứng từ FHIR path: VNCoreDocumentReference.date | VNCoreComposition.date"/>
    </rule>
  </group>
</StructureMap>