# text.div
Generated Narrative: StructureMap vn-sm-bhyt-xml6-hiv-care

map "http://fhir.hl7.org.vn/core/StructureMap/vn-sm-bhyt-xml6-hiv-care" = "BHYTXML6HIVCareLMStructureMap"

// Generated StructureMap scaffold for Bảng 6 hồ sơ HIV/AIDS — XML6 HIV/AIDS Care Logical Model. Source semantics come from the logical model mapping annotations in `BHYTXML6HIVCareLM.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/bhytXml6HivCareLm" alias BHYTXML6HIVCareLM as target // Bảng 6 hồ sơ HIV/AIDS — XML6 HIV/AIDS Care Logical Model

// Rows are derived from HIV/AIDS/TB clinical resources and supporting documents. This table was previously mis-numbered in draft FSH and must not be confused with discharge documents. 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 MapBHYTXML6HIVCareLM(source sourceBundle : BHYTSubmissionBundle, target targetRow : BHYTXML6HIVCareLM) {
  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 sttSource -> targetRow.stt "stt"; // Target field: STT - Số thứ tự dòng FHIR path: Derived export row order for HIV care rows
  sourceBundle.entry as maTheBhytSource -> targetRow.maTheBhyt "maTheBhyt"; // Target field: MA_THE_BHYT - Mã thẻ BHYT FHIR path: VNCoreCoverage.identifier[BHYT].value
  sourceBundle.entry as ngaySinhSource -> targetRow.ngaySinh "ngaySinh"; // Target field: NGAY_SINH - Ngày sinh FHIR path: VNCorePatient.birthDate
  sourceBundle.entry as gioiTinhSource -> targetRow.gioiTinh "gioiTinh"; // Target field: GIOI_TINH - Giới tính FHIR path: VNCorePatient.gender
  sourceBundle.entry as diaChiSource -> targetRow.diaChi "diaChi"; // Target field: DIA_CHI - Địa chỉ cư trú FHIR path: VNCorePatient.address.text
  sourceBundle.entry as maTinhCuTruSource -> targetRow.maTinhCuTru "maTinhCuTru"; // Target field: MATINH_CU_TRU - Mã tỉnh cư trú FHIR path: VNCorePatient.address.extension[province].valueCoding.code
  sourceBundle.entry as maHuyenCuTruSource -> targetRow.maHuyenCuTru "maHuyenCuTru"; // Target field: MAHUYEN_CU_TRU - Mã huyện cư trú legacy FHIR path: VNCorePatient.address.district
  sourceBundle.entry as maXaCuTruSource -> targetRow.maXaCuTru "maXaCuTru"; // Target field: MAXA_CU_TRU - Mã xã cư trú FHIR path: VNCorePatient.address.extension[ward].valueCoding.code
  sourceBundle.entry as ngayKdHivSource -> targetRow.ngayKdHiv "ngayKdHiv"; // Target field: NGAYKD_HIV - Ngày khẳng định HIV FHIR path: VNCoreCondition.onsetDateTime | VNCoreObservation.effectiveDateTime Mapping note: The local OHP validator marks NGAYKD_HIV required, but its rule text notes the legal/source exception for exposure prophylaxis. Keep optional until the exception is confirmed in the normative source.
  sourceBundle.entry as lyDoChuyenPhacDoSource -> targetRow.lyDoChuyenPhacDo "lyDoChuyenPhacDo"; // Target field: LY_DO_CHUYEN_PHAC_DO - Lý do chuyển phác đồ FHIR path: VNCoreMedicationRequest.reasonCode | VNCoreDocumentReference.category | future HIV workflow extension
  sourceBundle.entry as maCskcbSource -> targetRow.maCskcb "maCskcb"; // Target field: MA_CSKCB - Mã cơ sở KCB FHIR path: VNCoreEncounter.serviceProvider.resolve().identifier[CSKCB].value | VNCoreClaim.provider.resolve().identifier[CSKCB].value
}

# title
Bảng 6 hồ sơ HIV/AIDS — XML6 HIV/AIDS Care 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 6 hồ sơ HIV/AIDS — XML6 HIV/AIDS Care Logical Model. Source semantics come from the logical model mapping annotations in `BHYTXML6HIVCareLM.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 6 hồ sơ HIV/AIDS — XML6 HIV/AIDS Care Logical Model

# group[].documentation
Rows are derived from HIV/AIDS/TB clinical resources and supporting documents. This table was previously mis-numbered in draft FSH and must not be confused with discharge documents. 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 6 hồ sơ HIV/AIDS — XML6 HIV/AIDS Care 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: STT - Số thứ tự dòng FHIR path: Derived export row order for HIV care rows

# group[].rule[].documentation
Target field: MA_THE_BHYT - Mã thẻ BHYT FHIR path: VNCoreCoverage.identifier[BHYT].value

# group[].rule[].documentation
Target field: NGAY_SINH - Ngày sinh FHIR path: VNCorePatient.birthDate

# group[].rule[].documentation
Target field: GIOI_TINH - Giới tính FHIR path: VNCorePatient.gender

# group[].rule[].documentation
Target field: DIA_CHI - Địa chỉ cư trú FHIR path: VNCorePatient.address.text

# group[].rule[].documentation
Target field: MATINH_CU_TRU - Mã tỉnh cư trú FHIR path: VNCorePatient.address.extension[province].valueCoding.code

# group[].rule[].documentation
Target field: MAHUYEN_CU_TRU - Mã huyện cư trú legacy FHIR path: VNCorePatient.address.district

# group[].rule[].documentation
Target field: MAXA_CU_TRU - Mã xã cư trú FHIR path: VNCorePatient.address.extension[ward].valueCoding.code

# group[].rule[].documentation
Target field: NGAYKD_HIV - Ngày khẳng định HIV FHIR path: VNCoreCondition.onsetDateTime | VNCoreObservation.effectiveDateTime Mapping note: The local OHP validator marks NGAYKD_HIV required, but its rule text notes the legal/source exception for exposure prophylaxis. Keep optional until the exception is confirmed in the normative source.

# group[].rule[].documentation
Target field: LY_DO_CHUYEN_PHAC_DO - Lý do chuyển phác đồ FHIR path: VNCoreMedicationRequest.reasonCode | VNCoreDocumentReference.category | future HIV workflow extension