@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# - resource -------------------------------------------------------------------

<http://fhir.hl7.org.vn/core/StructureMap/vn-sm-bhyt-xml4-cls> a fhir:StructureMap ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:id [ fhir:v "vn-sm-bhyt-xml4-cls"] ; # 
  fhir:language [ fhir:v "vi"] ; # 
  fhir:text [
     fhir:status [ fhir:v "generated" ] ;
     fhir:div [ fhir:v "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: StructureMap vn-sm-bhyt-xml4-cls</b></p><a name=\"vn-sm-bhyt-xml4-cls\"> </a><a name=\"hcvn-sm-bhyt-xml4-cls\"> </a><pre class=\"fml\">#xD;\n<b>map</b><span style=\"color: navy\"> \"</span>http://fhir.hl7.org.vn/core/StructureMap/vn-sm-bhyt-xml4-cls<span style=\"color: navy\">\" = \"</span>BHYTXML4CLSLMStructureMap<span style=\"color: navy\">\"#xD;\n#xD;\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">Generated StructureMap scaffold for Bảng 4 cận lâm sàng BHYT — Logical Model. Source semantics come from the logical model mapping annotations in `BHYTXML4CLSLM.fsh` and remain aligned with the Python BHYT round-trip export adapter.</span>#xD;\n#xD;\n<b>uses</b><span style=\"color: navy\"> \"</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\">\" </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>#xD;\n<b>uses</b><span style=\"color: navy\"> \"</span><a href=\"StructureDefinition-bhytXml4ClsLm.html\" title=\"Bảng 4 cận lâm sàng BHYT — Logical Model\">http://fhir.hl7.org.vn/core/StructureDefinition/bhytXml4ClsLm</a><span style=\"color: navy\">\" </span><b>alias </b>BHYTXML4CLSLM <b>as </b><b>target</b> <span style=\"color: navy\">// </span><span style=\"color: green\">Bảng 4 cận lâm sàng BHYT — Logical Model</span>#xD;\n#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">Rows are derived from VNCoreDiagnosticReport and the linked VNCoreObservationLab results. 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>#xD;\n<b>group </b>MapBHYTXML4CLSLM<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>BHYTXML4CLSLM<span style=\"color: navy\">)</span><span style=\"color: navy\"> {#xD;\n</span>  sourceBundle.entry<b> as </b><span style=\"color: maroon\">maLkSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.maLk <i>\"maLk\"</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: Mã liên kết hồ sơ FHIR path: VNCoreClaim.identifier[MALK].value</span>#xD;\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">sttSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.stt <i>\"stt\"</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: Số thứ tự dòng FHIR path: Derived export row order from VNCoreDiagnosticReport collection</span>#xD;\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">maDichVuSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.maDichVu <i>\"maDichVu\"</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: MA_DICH_VU - Mã dịch vụ cận lâm sàng FHIR path: VNCoreDiagnosticReport.code.coding.code</span>#xD;\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">maChiSoSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.maChiSo <i>\"maChiSo\"</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: MA_CHI_SO - Mã chỉ số cận lâm sàng FHIR path: VNCoreObservationLab.code.coding.code</span>#xD;\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">tenChiSoSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.tenChiSo <i>\"tenChiSo\"</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: TEN_CHI_SO - Tên chỉ số cận lâm sàng FHIR path: VNCoreObservationLab.code.text | VNCoreObservationLab.code.coding.display</span>#xD;\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">giaTriSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.giaTri <i>\"giaTri\"</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: GIA_TRI - Giá trị kết quả FHIR path: VNCoreObservationLab.value[x]</span>#xD;\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">donViDoSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.donViDo <i>\"donViDo\"</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: DON_VI_DO - Đơn vị đo FHIR path: VNCoreObservationLab.valueQuantity.unit | VNCoreObservationLab.valueQuantity.code</span>#xD;\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">ngayKqSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.ngayKq <i>\"ngayKq\"</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: NGAY_KQ - Ngày kết quả theo định dạng yyyyMMddHHmm FHIR path: VNCoreDiagnosticReport.issued | VNCoreObservationLab.effectiveDateTime</span>#xD;\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">maBsDocKqSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.maBsDocKq <i>\"maBsDocKq\"</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: MA_BS_DOC_KQ - Mã bác sĩ đọc kết quả FHIR path: VNCoreDiagnosticReport.resultsInterpreter.resolve().identifier.value | VNCorePractitioner.identifier.value</span>#xD;\n<span style=\"color: navy\">}#xD;\n#xD;\n</span></pre></div>"^^rdf:XMLLiteral ]
  ] ; # 
  fhir:url [
     fhir:v "http://fhir.hl7.org.vn/core/StructureMap/vn-sm-bhyt-xml4-cls"^^xsd:anyURI ;
     fhir:l <http://fhir.hl7.org.vn/core/StructureMap/vn-sm-bhyt-xml4-cls>
  ] ; # 
  fhir:version [ fhir:v "0.5.0"] ; # 
  fhir:name [ fhir:v "BHYTXML4CLSLMStructureMap"] ; # 
  fhir:title [ fhir:v "Bảng 4 cận lâm sàng BHYT — Logical Model — StructureMap"] ; # 
  fhir:status [ fhir:v "draft"] ; # 
  fhir:experimental [ fhir:v false] ; # 
  fhir:date [ fhir:v "2026-04-28"^^xsd:date] ; # 
  fhir:publisher [ fhir:v "Omi HealthTech / VN Core FHIR Community Initiative"] ; # 
  fhir:contact ( [
     fhir:name [ fhir:v "Omi HealthTech / VN Core FHIR Community Initiative" ] ;
     fhir:telecom ( [
       fhir:system [ fhir:v "url" ] ;
       fhir:value [ fhir:v "https://hl7.org.vn" ]
     ] [
       fhir:system [ fhir:v "email" ] ;
       fhir:value [ fhir:v "info@hl7.org.vn" ]
     ] )
  ] [
     fhir:name [ fhir:v "Omi HealthTech (OmiGroup)" ] ;
     fhir:telecom ( [
       fhir:system [ fhir:v "url" ] ;
       fhir:value [ fhir:v "https://omihealthtech.vn" ]
     ] [
       fhir:system [ fhir:v "url" ] ;
       fhir:value [ fhir:v "https://omigroup.vn" ]
     ] [
       fhir:system [ fhir:v "email" ] ;
       fhir:value [ fhir:v "healthtech@omigroup.vn" ]
     ] )
  ] ) ; # 
  fhir:description [ fhir:v "Generated StructureMap scaffold for Bảng 4 cận lâm sàng BHYT — Logical Model. Source semantics come from the logical model mapping annotations in `BHYTXML4CLSLM.fsh` and remain aligned with the Python BHYT round-trip export adapter."] ; # 
  fhir:jurisdiction ( [
     fhir:coding ( [
       fhir:system [
         fhir:v "urn:iso:std:iso:3166"^^xsd:anyURI ;
         fhir:l <urn:iso:std:iso:3166>
       ] ;
       fhir:code [ fhir:v "VN" ] ;
       fhir:display [ fhir:v "Viet Nam" ]
     ] )
  ] ) ; # 
  fhir:purpose [ fhir:v "Publish canonical, reviewable FHIR-to-BHYT XML mapping artifacts for XML1-XML12 without duplicating field-level mapping semantics across FSH, wiki, and export code."] ; # 
  fhir:structure ( [
     fhir:url [
       fhir:v "http://fhir.hl7.org.vn/core/StructureDefinition/vn-core-bhyt-submission-bundle"^^xsd:anyURI ;
       fhir:l <http://fhir.hl7.org.vn/core/StructureDefinition/vn-core-bhyt-submission-bundle>
     ] ;
     fhir:mode [ fhir:v "source" ] ;
     fhir:alias [ fhir:v "BHYTSubmissionBundle" ] ;
     fhir:documentation [ fhir:v "FHIR-native source bundle profile used by the repository round-trip adapter." ]
  ] [
     fhir:url [
       fhir:v "http://fhir.hl7.org.vn/core/StructureDefinition/bhytXml4ClsLm"^^xsd:anyURI ;
       fhir:l <http://fhir.hl7.org.vn/core/StructureDefinition/bhytXml4ClsLm>
     ] ;
     fhir:mode [ fhir:v "target" ] ;
     fhir:alias [ fhir:v "BHYTXML4CLSLM" ] ;
     fhir:documentation [ fhir:v "Bảng 4 cận lâm sàng BHYT — Logical Model" ]
  ] ) ; # 
  fhir:group ( [
     fhir:name [ fhir:v "MapBHYTXML4CLSLM" ] ;
     fhir:typeMode [ fhir:v "none" ] ;
     fhir:documentation [ fhir:v "Rows are derived from VNCoreDiagnosticReport and the linked VNCoreObservationLab results. 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`." ] ;
     fhir:input ( [
       fhir:name [ fhir:v "sourceBundle" ] ;
       fhir:type [ fhir:v "BHYTSubmissionBundle" ] ;
       fhir:mode [ fhir:v "source" ] ;
       fhir:documentation [ fhir:v "VN Core BHYT submission bundle." ]
     ] [
       fhir:name [ fhir:v "targetRow" ] ;
       fhir:type [ fhir:v "BHYTXML4CLSLM" ] ;
       fhir:mode [ fhir:v "target" ] ;
       fhir:documentation [ fhir:v "Bảng 4 cận lâm sàng BHYT — Logical Model" ]
     ] ) ;
     fhir:rule ( [
       fhir:name [ fhir:v "maLk" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "sourceBundle" ] ;
         fhir:min [ fhir:v 0 ] ;
         fhir:max [ fhir:v "*" ] ;
         fhir:element [ fhir:v "entry" ] ;
         fhir:variable [ fhir:v "maLkSource" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "targetRow" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "maLk" ]
       ] ) ;
       fhir:documentation [ fhir:v "Target field: Mã liên kết hồ sơ FHIR path: VNCoreClaim.identifier[MALK].value" ]
     ] [
       fhir:name [ fhir:v "stt" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "sourceBundle" ] ;
         fhir:min [ fhir:v 0 ] ;
         fhir:max [ fhir:v "*" ] ;
         fhir:element [ fhir:v "entry" ] ;
         fhir:variable [ fhir:v "sttSource" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "targetRow" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "stt" ]
       ] ) ;
       fhir:documentation [ fhir:v "Target field: Số thứ tự dòng FHIR path: Derived export row order from VNCoreDiagnosticReport collection" ]
     ] [
       fhir:name [ fhir:v "maDichVu" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "sourceBundle" ] ;
         fhir:min [ fhir:v 0 ] ;
         fhir:max [ fhir:v "*" ] ;
         fhir:element [ fhir:v "entry" ] ;
         fhir:variable [ fhir:v "maDichVuSource" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "targetRow" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "maDichVu" ]
       ] ) ;
       fhir:documentation [ fhir:v "Target field: MA_DICH_VU - Mã dịch vụ cận lâm sàng FHIR path: VNCoreDiagnosticReport.code.coding.code" ]
     ] [
       fhir:name [ fhir:v "maChiSo" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "sourceBundle" ] ;
         fhir:min [ fhir:v 0 ] ;
         fhir:max [ fhir:v "*" ] ;
         fhir:element [ fhir:v "entry" ] ;
         fhir:variable [ fhir:v "maChiSoSource" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "targetRow" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "maChiSo" ]
       ] ) ;
       fhir:documentation [ fhir:v "Target field: MA_CHI_SO - Mã chỉ số cận lâm sàng FHIR path: VNCoreObservationLab.code.coding.code" ]
     ] [
       fhir:name [ fhir:v "tenChiSo" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "sourceBundle" ] ;
         fhir:min [ fhir:v 0 ] ;
         fhir:max [ fhir:v "*" ] ;
         fhir:element [ fhir:v "entry" ] ;
         fhir:variable [ fhir:v "tenChiSoSource" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "targetRow" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "tenChiSo" ]
       ] ) ;
       fhir:documentation [ fhir:v "Target field: TEN_CHI_SO - Tên chỉ số cận lâm sàng FHIR path: VNCoreObservationLab.code.text | VNCoreObservationLab.code.coding.display" ]
     ] [
       fhir:name [ fhir:v "giaTri" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "sourceBundle" ] ;
         fhir:min [ fhir:v 0 ] ;
         fhir:max [ fhir:v "*" ] ;
         fhir:element [ fhir:v "entry" ] ;
         fhir:variable [ fhir:v "giaTriSource" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "targetRow" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "giaTri" ]
       ] ) ;
       fhir:documentation [ fhir:v "Target field: GIA_TRI - Giá trị kết quả FHIR path: VNCoreObservationLab.value[x]" ]
     ] [
       fhir:name [ fhir:v "donViDo" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "sourceBundle" ] ;
         fhir:min [ fhir:v 0 ] ;
         fhir:max [ fhir:v "*" ] ;
         fhir:element [ fhir:v "entry" ] ;
         fhir:variable [ fhir:v "donViDoSource" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "targetRow" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "donViDo" ]
       ] ) ;
       fhir:documentation [ fhir:v "Target field: DON_VI_DO - Đơn vị đo FHIR path: VNCoreObservationLab.valueQuantity.unit | VNCoreObservationLab.valueQuantity.code" ]
     ] [
       fhir:name [ fhir:v "ngayKq" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "sourceBundle" ] ;
         fhir:min [ fhir:v 0 ] ;
         fhir:max [ fhir:v "*" ] ;
         fhir:element [ fhir:v "entry" ] ;
         fhir:variable [ fhir:v "ngayKqSource" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "targetRow" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "ngayKq" ]
       ] ) ;
       fhir:documentation [ fhir:v "Target field: NGAY_KQ - Ngày kết quả theo định dạng yyyyMMddHHmm FHIR path: VNCoreDiagnosticReport.issued | VNCoreObservationLab.effectiveDateTime" ]
     ] [
       fhir:name [ fhir:v "maBsDocKq" ] ;
       fhir:source ( [
         fhir:context [ fhir:v "sourceBundle" ] ;
         fhir:min [ fhir:v 0 ] ;
         fhir:max [ fhir:v "*" ] ;
         fhir:element [ fhir:v "entry" ] ;
         fhir:variable [ fhir:v "maBsDocKqSource" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "targetRow" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "maBsDocKq" ]
       ] ) ;
       fhir:documentation [ fhir:v "Target field: MA_BS_DOC_KQ - Mã bác sĩ đọc kết quả FHIR path: VNCoreDiagnosticReport.resultsInterpreter.resolve().identifier.value | VNCorePractitioner.identifier.value" ]
     ] )
  ] ) . # 

# -------------------------------------------------------------------------------------

