@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-pathology-report-code-vs> a fhir:ValueSet ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:Resource.id [ fhir:value "vn-pathology-report-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-pathology-report-code-vs</b></p><a name=\"vn-pathology-report-code-vs\"> </a><a name=\"hcvn-pathology-report-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 CLASS  matches (by regex) ^(PATH|CYTO|MOLPATH) 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  = 04</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: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:ValueSet.url [ fhir:value "http://fhir.hl7.org.vn/core/ValueSet/vn-pathology-report-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.160" ]
  ] ;
  fhir:ValueSet.version [ fhir:value "0.10.0"] ;
  fhir:ValueSet.name [ fhir:value "VNPathologyReportCodeVS"] ;
  fhir:ValueSet.title [ fhir:value "Mã báo cáo giải phẫu bệnh — VN Pathology Report Code ValueSet"] ;
  fhir:ValueSet.status [ fhir:value "draft"] ;
  fhir:ValueSet.experimental [ fhir:value "false"^^xsd:boolean] ;
  fhir:ValueSet.date [ fhir:value "2026-08-12"^^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 `DiagnosticReport.code` của báo cáo GIẢI PHẪU BỆNH:\n\n- **LOINC** (`http://loinc.org`) — mã báo cáo GPB quốc tế (vd 60568-3 Pathology synoptic report).\n- **Miền giải phẫu bệnh của danh mục CLS** (`vn-cls-cs` Phụ lục 04, QĐ 1227/QĐ-BYT).\n\nTrước 0.10.0 child profile Pathology chỉ fix `category` mà kế thừa binding toàn danh mục\n`vn-cls-vs` của base — báo cáo GPB nhận được cả mã xét nghiệm/hình ảnh (CORE-P1-03/T-03,\nreview 97). Từ 0.10.0 phần LOINC được lọc theo miền ở tầng compose:\n`CLASS regex ^(PATH|CYTO|MOLPATH)` cộng `STATUS in ACTIVE, TRIAL`. Hai tầng canh: filter VS\nkhi có máy chủ thuật ngữ, và graph gate `[LOINC-DOMAIN]` đối chiếu offline cho corpus ví dụ.\n\n**ĐÃ ĐO LẠI 03/09/2026: nhánh LOINC nay expand ĐÚNG.** `$expand` trả **3.502** mã, so với 81 mã\n(toàn bộ từ `vn-cls-cs`) ở lần đo 30/08/2026. Phép đếm độc lập trên `data/loinc/loinc_detail.jsonl`\ncho 3.491 mã khớp biểu thức `CLASS`, còn **3.423** sau khi áp `STATUS in ACTIVE,TRIAL` — cộng phần\n`vn-cls-cs` thì khớp tổng máy chủ trả về. Nguyên nhân lần đo cũ ra rỗng: máy chủ chưa được nạp\nproperty `CLASS`; `scripts/txserver-load.py` bổ sung nó ngày 02/09/2026. Chi tiết chẩn đoán ghi ở\n[VNImagingReportCodeVS](ValueSet-vn-imaging-report-code-vs.html).\n\nLƯU Ý biểu thức ở đây KHÔNG neo cuối chuỗi (`^(PATH|CYTO|MOLPATH)`, không có `$`) — khác\nVNImagingReportCodeVS vốn neo cả hai đầu. Đây là CHỦ Ý: nhánh con của MOLPATH phải vào tập, và\nchúng chiếm phần lớn — MOLPATH.MUT 1.276 · PATH 689 · MOLPATH 662 · MOLPATH.TRNLOC 139 ·\nMOLPATH.PHARMG 123 · MOLPATH.REARRANGE 93. Neo `$` ở đây sẽ cắt mất toàn bộ giải phẫu bệnh phân tử.\n\nHàng rào miền nay có hai tầng đều hiệu lực: filter tập giá trị khi có máy chủ thuật ngữ, và graph\ngate `[LOINC-DOMAIN]` cho bản dựng offline."] ;
  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.purpose [ fhir:value "Binding theo miền cho VNCoreDiagnosticReportPathology.code — báo cáo giải phẫu bệnh không mang mã xét nghiệm/hình ảnh của danh mục CLS."] ;
  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 "CLASS" ] ;
         fhir:ValueSet.compose.include.filter.op [ fhir:value "regex" ] ;
         fhir:ValueSet.compose.include.filter.value [ fhir:value "^(PATH|CYTO|MOLPATH)" ]
       ], [
         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 "04" ]
       ]
     ]
  ] .

# - ontology header ------------------------------------------------------------

<http://fhir.hl7.org.vn/core/ValueSet/vn-pathology-report-code-vs.ttl> a owl:Ontology ;
  owl:imports fhir:fhir.ttl .

# -------------------------------------------------------------------------------------

