@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-xml5-clinical-course> a fhir:StructureMap ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:id [ fhir:v "vn-sm-bhyt-xml5-clinical-course"] ; # 
  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-xml5-clinical-course</b></p><a name=\"vn-sm-bhyt-xml5-clinical-course\"> </a><a name=\"hcvn-sm-bhyt-xml5-clinical-course\"> </a><pre class=\"fml\">#xD;\n<b>map</b><span style=\"color: navy\"> \"</span>http://fhir.hl7.org.vn/core/StructureMap/vn-sm-bhyt-xml5-clinical-course<span style=\"color: navy\">\" = \"</span>BHYTXML5ClinicalCourseLMStructureMap<span style=\"color: navy\">\"#xD;\n#xD;\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">Generated StructureMap scaffold for Bảng 5 diễn biến lâm sàng BHYT — Logical Model. Source semantics come from the logical model mapping annotations in `BHYTXML5ClinicalCourseLM.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-bhytXml5ClinicalCourseLm.html\" title=\"Bảng 5 diễn biến lâm sàng BHYT — Logical Model\">http://fhir.hl7.org.vn/core/StructureDefinition/bhytXml5ClinicalCourseLm</a><span style=\"color: navy\">\" </span><b>alias </b>BHYTXML5ClinicalCourseLM <b>as </b><b>target</b> <span style=\"color: navy\">// </span><span style=\"color: green\">Bảng 5 diễn biế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 clinical-course timeline entries. QD 3176 XML5 currently carries row order, event time, and performer metadata only. 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>MapBHYTXML5ClinicalCourseLM<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>BHYTXML5ClinicalCourseLM<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: STT - Số thứ tự dòng FHIR path: Derived export row order from the clinical course timeline</span>#xD;\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">thoiDiemDblsSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.thoiDiemDbls <i>\"thoiDiemDbls\"</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: THOI_DIEM_DBLS - Thời điểm diễn biến lâm sàng theo định dạng yyyyMMddHHmm FHIR path: VNCoreComposition.date | VNCoreObservation.effectiveDateTime</span>#xD;\n  sourceBundle.entry<b> as </b><span style=\"color: maroon\">nguoiThucHienSource</span><span style=\"color: navy\"><b> -&gt; </b></span>targetRow.nguoiThucHien <i>\"nguoiThucHien\"</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Target field: NGUOI_THUC_HIEN - Mã người thực hiện FHIR path: VNCoreComposition.author.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-xml5-clinical-course"^^xsd:anyURI ;
     fhir:l <http://fhir.hl7.org.vn/core/StructureMap/vn-sm-bhyt-xml5-clinical-course>
  ] ; # 
  fhir:version [ fhir:v "0.5.0"] ; # 
  fhir:name [ fhir:v "BHYTXML5ClinicalCourseLMStructureMap"] ; # 
  fhir:title [ fhir:v "Bảng 5 diễn biế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 5 diễn biến lâm sàng BHYT — Logical Model. Source semantics come from the logical model mapping annotations in `BHYTXML5ClinicalCourseLM.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/bhytXml5ClinicalCourseLm"^^xsd:anyURI ;
       fhir:l <http://fhir.hl7.org.vn/core/StructureDefinition/bhytXml5ClinicalCourseLm>
     ] ;
     fhir:mode [ fhir:v "target" ] ;
     fhir:alias [ fhir:v "BHYTXML5ClinicalCourseLM" ] ;
     fhir:documentation [ fhir:v "Bảng 5 diễn biến lâm sàng BHYT — Logical Model" ]
  ] ) ; # 
  fhir:group ( [
     fhir:name [ fhir:v "MapBHYTXML5ClinicalCourseLM" ] ;
     fhir:typeMode [ fhir:v "none" ] ;
     fhir:documentation [ fhir:v "Rows are derived from clinical-course timeline entries. QD 3176 XML5 currently carries row order, event time, and performer metadata only. 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 "BHYTXML5ClinicalCourseLM" ] ;
       fhir:mode [ fhir:v "target" ] ;
       fhir:documentation [ fhir:v "Bảng 5 diễn biế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: STT - Số thứ tự dòng FHIR path: Derived export row order from the clinical course timeline" ]
     ] [
       fhir:name [ fhir:v "thoiDiemDbls" ] ;
       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 "thoiDiemDblsSource" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "targetRow" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "thoiDiemDbls" ]
       ] ) ;
       fhir:documentation [ fhir:v "Target field: THOI_DIEM_DBLS - Thời điểm diễn biến lâm sàng theo định dạng yyyyMMddHHmm FHIR path: VNCoreComposition.date | VNCoreObservation.effectiveDateTime" ]
     ] [
       fhir:name [ fhir:v "nguoiThucHien" ] ;
       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 "nguoiThucHienSource" ]
       ] ) ;
       fhir:target ( [
         fhir:context [ fhir:v "targetRow" ] ;
         fhir:contextType [ fhir:v "variable" ] ;
         fhir:element [ fhir:v "nguoiThucHien" ]
       ] ) ;
       fhir:documentation [ fhir:v "Target field: NGUOI_THUC_HIEN - Mã người thực hiện FHIR path: VNCoreComposition.author.resolve().identifier.value | VNCorePractitioner.identifier.value" ]
     ] )
  ] ) . # 

# -------------------------------------------------------------------------------------

