# text.div
Generated Narrative: StructureMap vn-sm-bhyt-xml10-maternity-leave

map "http://fhir.hl7.org.vn/core/StructureMap/vn-sm-bhyt-xml10-maternity-leave" = "BHYTXML10MaternityLeaveLMStructureMap"

// 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.

uses "http://fhir.hl7.org.vn/core/StructureDefinition/vn-core-bhyt-submission-bundle" alias BHYTSubmissionBundle as source // FHIR-native source bundle profile used by the repository round-trip adapter.
uses "http://fhir.hl7.org.vn/core/StructureDefinition/bhytXml10MaternityLeaveLm" alias BHYTXML10MaternityLeaveLM as target // Bảng 10 giấy chứng nhận nghỉ dưỡng thai — XML10 Maternity Leave Logical Model

// 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`.
group MapBHYTXML10MaternityLeaveLM(source sourceBundle : BHYTSubmissionBundle, target targetRow : BHYTXML10MaternityLeaveLM) {
  sourceBundle.entry as maLkSource -> targetRow.maLk "maLk"; // Target field: MA_LK - Mã liên kết hồ sơ FHIR path: VNCoreClaim.identifier[MALK].value
  sourceBundle.entry as soSeriSource -> targetRow.soSeri "soSeri"; // Target field: SO_SERI - Số seri FHIR path: VNCoreDocumentReference.identifier.value | VNCoreComposition.identifier.value
  sourceBundle.entry as soCtSource -> targetRow.soCt "soCt"; // Target field: SO_CT - Số chứng từ FHIR path: VNCoreDocumentReference.identifier.value | VNCoreComposition.identifier.value
  sourceBundle.entry as soNgaySource -> targetRow.soNgay "soNgay"; // Target field: SO_NGAY - Số ngày FHIR path: Derived from VNCoreDocumentReference.context.period | VNCoreComposition.event.period
  sourceBundle.entry as donViSource -> targetRow.donVi "donVi"; // Target field: DON_VI - Đơn vị FHIR path: VNCoreOrganization.name | VNCoreDocumentReference.custodian.resolve().name
  sourceBundle.entry as tuNgaySource -> targetRow.tuNgay "tuNgay"; // Target field: TU_NGAY - Từ ngày FHIR path: VNCoreDocumentReference.context.period.start
  sourceBundle.entry as denNgaySource -> targetRow.denNgay "denNgay"; // Target field: DEN_NGAY - Đến ngày FHIR path: VNCoreDocumentReference.context.period.end
  sourceBundle.entry as maTtdvSource -> targetRow.maTtdv "maTtdv"; // 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
  sourceBundle.entry as tenBsSource -> targetRow.tenBs "tenBs"; // Target field: TEN_BS - Tên bác sĩ FHIR path: VNCoreComposition.author.display | VNCorePractitioner.name.text
  sourceBundle.entry as maBsSource -> targetRow.maBs "maBs"; // Target field: MA_BS - Mã bác sĩ FHIR path: VNCoreComposition.author.resolve().identifier.value | VNCorePractitioner.identifier.value
  sourceBundle.entry as ngayCtSource -> targetRow.ngayCt "ngayCt"; // Target field: NGAY_CT - Ngày cấp chứng từ FHIR path: VNCoreDocumentReference.date | VNCoreComposition.date
}

# title
Bảng 10 giấy chứng nhận nghỉ dưỡng thai — XML10 Maternity Leave Logical Model — StructureMap

# publisher
Omi HealthTech / VN Core FHIR Community Initiative

# contact[].name
Omi HealthTech / VN Core FHIR Community Initiative

# description
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.

# 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[].documentation
FHIR-native source bundle profile used by the repository round-trip adapter.

# structure[].documentation
Bảng 10 giấy chứng nhận nghỉ dưỡng thai — XML10 Maternity Leave Logical Model

# group[].documentation
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`.

# group[].input[].documentation
Bảng 10 giấy chứng nhận nghỉ dưỡng thai — XML10 Maternity Leave Logical Model

# group[].rule[].documentation
Target field: MA_LK - Mã liên kết hồ sơ FHIR path: VNCoreClaim.identifier[MALK].value

# group[].rule[].documentation
Target field: SO_SERI - Số seri FHIR path: VNCoreDocumentReference.identifier.value | VNCoreComposition.identifier.value

# group[].rule[].documentation
Target field: SO_CT - Số chứng từ FHIR path: VNCoreDocumentReference.identifier.value | VNCoreComposition.identifier.value

# group[].rule[].documentation
Target field: SO_NGAY - Số ngày FHIR path: Derived from VNCoreDocumentReference.context.period | VNCoreComposition.event.period

# group[].rule[].documentation
Target field: DON_VI - Đơn vị FHIR path: VNCoreOrganization.name | VNCoreDocumentReference.custodian.resolve().name

# group[].rule[].documentation
Target field: TU_NGAY - Từ ngày FHIR path: VNCoreDocumentReference.context.period.start

# group[].rule[].documentation
Target field: DEN_NGAY - Đến ngày FHIR path: VNCoreDocumentReference.context.period.end

# group[].rule[].documentation
Target field: TEN_BS - Tên bác sĩ FHIR path: VNCoreComposition.author.display | VNCorePractitioner.name.text

# group[].rule[].documentation
Target field: MA_BS - Mã bác sĩ FHIR path: VNCoreComposition.author.resolve().identifier.value | VNCorePractitioner.identifier.value

# group[].rule[].documentation
Target field: NGAY_CT - Ngày cấp chứng từ FHIR path: VNCoreDocumentReference.date | VNCoreComposition.date