@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@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/ValueSet/vn-lab-observation-code-vs> a fhir:ValueSet ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:Resource.id [ fhir:value "vn-lab-observation-code-vs"] ;
  fhir:Resource.language [ fhir:value "vi"] ;
  fhir:DomainResource.text [
     fhir:Narrative.status [ fhir:value "generated" ] ;
     fhir:Narrative.div "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: ValueSet vn-lab-observation-code-vs</b></p><a name=\"vn-lab-observation-code-vs\"> </a><a name=\"hcvn-lab-observation-code-vs\"> </a><p>This value set includes codes based on the following rules:</p><ul><li>Include codes from<a href=\"http://loinc.org\"><code>http://loinc.org</code></a><span title=\"Version is not explicitly stated. No matching Code System found\"> version Not Stated (use latest from terminology server)</span> where CLASSTYPE  = 1 and STATUS  in ACTIVE,TRIAL</li><li>Include codes from<a href=\"CodeSystem-vn-cls-cs.html\"><code>http://fhir.hl7.org.vn/core/CodeSystem/vn-cls-cs</code></a><span title=\"Version is not explicitly stated, which means it is fixed to the version provided in this specification\"> version ?0.10.0</span> where appendix  = 01</li><li>Include codes from<a href=\"CodeSystem-vn-cls-cs.html\"><code>http://fhir.hl7.org.vn/core/CodeSystem/vn-cls-cs</code></a><span title=\"Version is not explicitly stated, which means it is fixed to the version provided in this specification\"> version ?0.10.0</span> where appendix  = 02</li><li>Include codes from<a href=\"CodeSystem-vn-cls-cs.html\"><code>http://fhir.hl7.org.vn/core/CodeSystem/vn-cls-cs</code></a><span title=\"Version is not explicitly stated, which means it is fixed to the version provided in this specification\"> version ?0.10.0</span> where appendix  = 03</li></ul></div>"
  ] ;
  fhir:DomainResource.extension [
     fhir:index -1 ;
     fhir:Extension.url [ fhir:value "http://fhir.hl7.org.vn/core/StructureDefinition/vn-ext-legal-basis" ] ;
     fhir:Extension.valueCoding [
       fhir:Element.extension [
         fhir:index -1 ;
         fhir:Extension.url [ fhir:value "http://fhir.hl7.org.vn/core/StructureDefinition/vn-ext-legal-basis-role" ] ;
         fhir:Extension.valueCode [ fhir:value "issuing" ]
       ] ;
       fhir:Coding.system [ fhir:value "http://fhir.hl7.org.vn/core/CodeSystem/vn-legal-document-ref-cs" ] ;
       fhir:Coding.code [ fhir:value "QD-1227-2025" ]
     ]
  ], [
     fhir:index -1 ;
     fhir:Extension.url [ fhir:value "http://fhir.hl7.org.vn/core/StructureDefinition/vn-ext-legal-basis" ] ;
     fhir:Extension.valueCoding [
       fhir:Element.extension [
         fhir:index -1 ;
         fhir:Extension.url [ fhir:value "http://fhir.hl7.org.vn/core/StructureDefinition/vn-ext-legal-basis-role" ] ;
         fhir:Extension.valueCode [ fhir:value "governing" ]
       ] ;
       fhir:Coding.system [ fhir:value "http://fhir.hl7.org.vn/core/CodeSystem/vn-legal-document-ref-cs" ] ;
       fhir:Coding.code [ fhir:value "TT-23-2024" ]
     ]
  ] ;
  fhir:ValueSet.url [ fhir:value "http://fhir.hl7.org.vn/core/ValueSet/vn-lab-observation-code-vs"] ;
  fhir:ValueSet.identifier [
     fhir:index -1 ;
     fhir:Identifier.system [ fhir:value "urn:ietf:rfc:3986" ] ;
     fhir:Identifier.value [ fhir:value "urn:oid:2.25.161089673617632664299011809196868855799.48.143" ]
  ] ;
  fhir:ValueSet.version [ fhir:value "0.10.0"] ;
  fhir:ValueSet.name [ fhir:value "VNLabObservationCodeVS"] ;
  fhir:ValueSet.title [ fhir:value "Mã kết quả xét nghiệm — VN Lab Observation Code ValueSet"] ;
  fhir:ValueSet.status [ fhir:value "draft"] ;
  fhir:ValueSet.experimental [ fhir:value "false"^^xsd:boolean] ;
  fhir:ValueSet.date [ fhir:value "2026-08-04"^^xsd:date] ;
  fhir:ValueSet.publisher [ fhir:value "Omi HealthTech / VN Core FHIR Community Initiative"] ;
  fhir:ValueSet.contact [
     fhir:index -1 ;
     fhir:ContactDetail.name [ fhir:value "Omi HealthTech / VN Core FHIR Community Initiative" ] ;
     fhir:ContactDetail.telecom [
       fhir:index -1 ;
       fhir:ContactPoint.system [ fhir:value "url" ] ;
       fhir:ContactPoint.value [ fhir:value "https://hl7.org.vn" ]
     ], [
       fhir:index -1 ;
       fhir:ContactPoint.system [ fhir:value "email" ] ;
       fhir:ContactPoint.value [ fhir:value "info@hl7.org.vn" ]
     ]
  ], [
     fhir:index -1 ;
     fhir:ContactDetail.name [ fhir:value "Omi HealthTech (OmiGroup)" ] ;
     fhir:ContactDetail.telecom [
       fhir:index -1 ;
       fhir:ContactPoint.system [ fhir:value "url" ] ;
       fhir:ContactPoint.value [ fhir:value "https://omihealthtech.vn" ]
     ], [
       fhir:index -1 ;
       fhir:ContactPoint.system [ fhir:value "url" ] ;
       fhir:ContactPoint.value [ fhir:value "https://omigroup.vn" ]
     ], [
       fhir:index -1 ;
       fhir:ContactPoint.system [ fhir:value "email" ] ;
       fhir:ContactPoint.value [ fhir:value "info@hl7.org.vn" ]
     ]
  ] ;
  fhir:ValueSet.description [ fhir:value "Tập giá trị cho `Observation.code` của kết quả xét nghiệm: gồm **cả hai** hệ mà thực tế Việt Nam đang dùng song song.\n\n- **LOINC** (`http://loinc.org`) — hệ quốc tế, dùng để trao đổi ra ngoài và để hệ thống nước ngoài đọc được.\n- **Miền xét nghiệm của danh mục chỉ số cận lâm sàng Việt Nam** (`vn-cls-cs`, Phụ lục 01-03 QĐ 1227/QĐ-BYT: Huyết học — Truyền máu, Sinh hoá, Vi sinh — 1.643/2.964 chỉ số), là danh mục các cơ sở phải mã hoá theo khi báo cáo và thanh toán.\n\n**Vì sao gộp hai hệ.** Trước 0.10.0, `VNCoreObservationLab.code` bind vào tập chung `observation-codes` của HL7, còn `vn-cls-vs` chỉ được dùng ở `DiagnosticReport`. Hệ quả: 2.964 chỉ số của danh mục quốc gia không ràng buộc được bất kỳ kết quả xét nghiệm nào, dù chính nó là danh mục bắt buộc. Cách gộp ở đây theo đúng khuôn đã dùng cho ICD-10 (`vn-icd10-vs`) và DVKT (`vn-procedure-code-vs`).\n\n**Vì sao chỉ miền xét nghiệm.** QĐ 1227/QĐ-BYT gộp ba miền nghiệp vụ — xét nghiệm (PL 01-03), giải phẫu bệnh (PL 04), chẩn đoán hình ảnh (PL 05) — vào một danh mục. Kết quả XÉT NGHIỆM không được mang mã chụp X-quang; từ 0.10.0 phần CLS của ValueSet này lọc theo property `appendix` để chỉ giữ miền xét nghiệm (kiểm toán 07/08/2026, mục 1.6). Miền khác dùng `vn-cls-pathology-vs` / `vn-cls-imaging-vs`; toàn danh mục ở `vn-cls-vs`.\n\n**Không thay nhau — và không tự động dual-code.** Mỗi chỉ số CLS đều có đích LOINC trong `vn-cm-cls-to-loinc`, nhưng đó là độ phủ kỹ thuật: chỉ 1.404/2.964 quan hệ là `equivalent`, còn 1.560 là `wider` — mã LOINC đích RỘNG HƠN khái niệm CLS nguồn. Gửi kèm coding LOINC chỉ đúng khi quan hệ là `equivalent`; với quan hệ `wider`, hệ thống không được tự sinh coding LOINC từ mã CLS như thể tương đương — làm vậy là ghi một kết quả xét nghiệm thành khái niệm rộng hơn thực tế. Xem ràng buộc `vn-lab-observation-code-system` trên profile."] ;
  fhir:ValueSet.jurisdiction [
     fhir:index -1 ;
     fhir:CodeableConcept.coding [
       fhir:index -1 ;
       fhir:Coding.system [ fhir:value "urn:iso:std:iso:3166" ] ;
       fhir:Coding.code [ fhir:value "VN" ] ;
       fhir:Coding.display [ fhir:value "Viet Nam" ]
     ]
  ] ;
  fhir:ValueSet.copyright [ fhir:value "Bộ Y tế Việt Nam — QĐ 1227/QĐ-BYT ngày 11/4/2025. LOINC là tài sản của Regenstrief Institute, Inc., dùng theo LOINC License."] ;
  fhir:ValueSet.compose [
     fhir:ValueSet.compose.include [
       fhir:index -1 ;
       fhir:ValueSet.compose.include.system [ fhir:value "http://loinc.org" ] ;
       fhir:ValueSet.compose.include.filter [
         fhir:index -1 ;
         fhir:ValueSet.compose.include.filter.property [ fhir:value "CLASSTYPE" ] ;
         fhir:ValueSet.compose.include.filter.op [ fhir:value "=" ] ;
         fhir:ValueSet.compose.include.filter.value [ fhir:value "1" ]
       ], [
         fhir:index -1 ;
         fhir:ValueSet.compose.include.filter.property [ fhir:value "STATUS" ] ;
         fhir:ValueSet.compose.include.filter.op [ fhir:value "in" ] ;
         fhir:ValueSet.compose.include.filter.value [ fhir:value "ACTIVE,TRIAL" ]
       ]
     ], [
       fhir:index -1 ;
       fhir:ValueSet.compose.include.system [ fhir:value "http://fhir.hl7.org.vn/core/CodeSystem/vn-cls-cs" ] ;
       fhir:ValueSet.compose.include.filter [
         fhir:index -1 ;
         fhir:ValueSet.compose.include.filter.property [ fhir:value "appendix" ] ;
         fhir:ValueSet.compose.include.filter.op [ fhir:value "=" ] ;
         fhir:ValueSet.compose.include.filter.value [ fhir:value "01" ]
       ]
     ], [
       fhir:index -1 ;
       fhir:ValueSet.compose.include.system [ fhir:value "http://fhir.hl7.org.vn/core/CodeSystem/vn-cls-cs" ] ;
       fhir:ValueSet.compose.include.filter [
         fhir:index -1 ;
         fhir:ValueSet.compose.include.filter.property [ fhir:value "appendix" ] ;
         fhir:ValueSet.compose.include.filter.op [ fhir:value "=" ] ;
         fhir:ValueSet.compose.include.filter.value [ fhir:value "02" ]
       ]
     ], [
       fhir:index -1 ;
       fhir:ValueSet.compose.include.system [ fhir:value "http://fhir.hl7.org.vn/core/CodeSystem/vn-cls-cs" ] ;
       fhir:ValueSet.compose.include.filter [
         fhir:index -1 ;
         fhir:ValueSet.compose.include.filter.property [ fhir:value "appendix" ] ;
         fhir:ValueSet.compose.include.filter.op [ fhir:value "=" ] ;
         fhir:ValueSet.compose.include.filter.value [ fhir:value "03" ]
       ]
     ]
  ] .

# - ontology header ------------------------------------------------------------

<http://fhir.hl7.org.vn/core/ValueSet/vn-lab-observation-code-vs.ttl> a owl:Ontology ;
  owl:imports fhir:fhir.ttl .

# -------------------------------------------------------------------------------------

