HL7 Vietnam VN Core FHIR Implementation Guide

Bộ Hướng dẫn Triển khai Core FHIR cho Việt Nam
0.6.0 - Draft for Community Review Viet Nam cờ

Bộ Hướng dẫn Triển khai Core FHIR cho Việt Nam - Draft for Community Review (v0.6.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

CodeSystem: Registry quy tắc kiểm tra hợp lệ VN Core — VN Core Validation Rule Registry

URL chính thức: http://fhir.hl7.org.vn/core/CodeSystem/vn-validation-rule-cs Phiên bản: 0.6.0
Computable Name: VNValidationRuleCS

Danh mục mã quy tắc kiểm tra hợp lệ (rule code) của VN Core — registry machine-readable cho từng quy tắc validate, ánh xạ sang OperationOutcome.issue.details.coding khi máy chủ trả lỗi.

Thiết kế FHIR-native (CodeSystem có property) thay cho mô hình bảng tính phân tán: mỗi mã rule mang sẵn severity, tầng kiểm tra (tier), phân loại căn cứ, biểu thức FHIRPath/quy tắc, tên invariant (nếu có) và căn cứ pháp lý.

Cách dùng trong OperationOutcome:

  • issue.details.coding.system = http://fhir.hl7.org.vn/core/CodeSystem/vn-validation-rule-cs
  • issue.details.coding.code = mã rule (vd VN-RULE-ENC-001)
  • issue.details.text = thông điệp (display)
  • issue.expression = FHIR path vi phạm
  • issue.severity = theo property severity của mã

Bổ trợ cho trang Hướng dẫn kiểm tra hợp lệ (chi tiết 3 tầng) và OperationOutcome & Registry quy tắc (quy ước phản hồi). / VN Core validation rule registry: a machine-readable CodeSystem mapping each validation rule to an OperationOutcome details coding, with severity, tier, category, FHIRPath expression, invariant name, and legal basis.

This Code system is referenced in the definition of the following value sets:

  • This CodeSystem is not used here; it may be used elsewhere (e.g. specifications and/or implementations that use this content)

Properties

This code system defines the following properties for its concepts

NameCodeURITypeDescription
severity severity http://fhir.hl7.org.vn/core/CodeSystem/vn-validation-rule-cs#severity string Mức độ trả về trong OperationOutcome: error | warning | information
tier tier http://fhir.hl7.org.vn/core/CodeSystem/vn-validation-rule-cs#tier string Tầng kiểm tra: tier-1 (FHIRPath invariant), tier-2 (server-side), tier-3 (business rule)
category category http://fhir.hl7.org.vn/core/CodeSystem/vn-validation-rule-cs#category string Phân loại căn cứ: normative-data-standard | legal-business-rule | profile-conformance | technical-quality-guardrail | source-exception
expression expression http://fhir.hl7.org.vn/core/CodeSystem/vn-validation-rule-cs#expression string Biểu thức FHIRPath hoặc tóm tắt quy tắc kiểm tra
invariant invariant http://fhir.hl7.org.vn/core/CodeSystem/vn-validation-rule-cs#invariant string Tên FHIRPath invariant tương ứng trong profile (nếu là tier-1)
legalBasis legalBasis http://fhir.hl7.org.vn/core/CodeSystem/vn-validation-rule-cs#legalBasis string Căn cứ pháp lý/chuẩn dữ liệu cho quy tắc

Concepts

This case-sensitive code system http://fhir.hl7.org.vn/core/CodeSystem/vn-validation-rule-cs defines the following codes:

CodeDisplayDefinitionseveritytiercategoryexpressioninvariantlegalBasisEnglish (English, en)
VN-RULE-PAT-001 Số CCCD phải đúng 12 chữ số Giá trị identifier[CCCD] phải khớp [0-9]{12}. Sửa: chuẩn hóa số CCCD 12 số; nếu là CMND cũ 9 số dùng slice/identifier khác. error tier-1 normative-data-standard Patient.identifier.where(system='.../sid/cccd').value.matches('[0-9]{12}') vn-cccd-format Luật Căn cước 2023 Điều 20 CCCD number must be exactly 12 digits
VN-RULE-PAT-002 Chữ số thứ 4 của CCCD không phù hợp giới tính Chữ số thứ 4 mã hóa giới tính/thế kỷ: nam→chẵn, nữ→lẻ. Cảnh báo vì có thể có ca chuyển giới chưa cập nhật CCCD. Kiểm tra phía server. warning tier-2 technical-quality-guardrail Luật Căn cước 2023 The 4th digit of CCCD does not match gender
VN-RULE-PAT-003 Mã xã/phường không thuộc tỉnh/TP đã chọn Khi có cả extension[province] và extension[ward], mã xã (5 số) phải thuộc tỉnh (2 số). Tra bảng ĐVHC theo thời điểm hiệu lực. Kiểm tra phía server. error tier-2 normative-data-standard QĐ 19/2025/QĐ-TTg; NQ 202/2025/QH15 Commune/ward code is not within selected province/city
VN-RULE-PAT-004 Cấp cứu: cho phép Patient chỉ có identifier tạm Trong cấp cứu, KHÔNG chặn tạo hồ sơ vì thiếu CCCD. Cho phép POST Patient với identifier tạm (use=temp) để xử trí trước, định danh sau. Quy tắc cho phép (permissive), không phải lỗi. information tier-3 profile-conformance QĐ 01/2008/QĐ-BYT (cấp cứu xử trí trước) Emergency: allow Patient to have only a temporary identifier
VN-RULE-PAT-005 Hợp nhất hồ sơ phải dùng Patient.link, không tạo định danh trùng Khi merge hồ sơ tạm với hồ sơ CCCD chính thức: dùng Patient.link (replaced-by/replaces), chuyển hồ sơ tạm active=false. KHÔNG xóa cứng, KHÔNG tạo định danh y tế (VHN) trùng. Kiểm tra phía server. error tier-2 profile-conformance Record merge shall use Patient.link, do not create duplicate identifiers
VN-RULE-ADDR-001 Địa chỉ Việt Nam phải có extension:province Địa chỉ có country='VN' nên có extension:province. Sửa: bổ sung mã tỉnh theo VNProvinceCS. warning tier-1 profile-conformance vn-addr-province Vietnam address must include extension:province
VN-RULE-ENC-001 Encounter.serviceProvider là bắt buộc Lượt khám phải gắn cơ sở KCB chịu trách nhiệm. Sửa: thêm Encounter.serviceProvider trỏ VNCoreOrganization. error tier-1 profile-conformance Encounter.serviceProvider.exists() QĐ 3176/QĐ-BYT Encounter.serviceProvider is required
VN-RULE-ENC-002 Encounter.period không được chồng lấn cho cùng bệnh nhân Trừ encounter lồng nhau, các period của cùng bệnh nhân không nên overlap. Kiểm tra phía server. warning tier-3 technical-quality-guardrail Encounter.period must not overlap for the same patient
VN-RULE-CON-001 Mỗi Condition chỉ nên ghi 1 chẩn đoán 1 resource Condition = 1 mã chẩn đoán (không gộp đa chẩn đoán). Sửa: tách thành nhiều Condition. warning tier-3 profile-conformance Each Condition should contain only one diagnosis
VN-RULE-MED-002 Cấp phát ngoại trú/bán lẻ phải có authorizingPrescription Không cấp phát 'mồ côi': cấp phát ngoại trú/nhà thuốc bán lẻ (category=outpatient/community) phải trỏ về VNCoreMedicationRequest để bảo toàn chuỗi kê đơn → cấp phát → thanh toán BHYT. Cấp phát nội trú từ tủ trực/khoa Dược nên gắn y lệnh khi có y lệnh tương ứng (vd ExampleMedicationDispenseInpatientAntibiotic → ExampleMedicationRequestCefotaximeInpatient). error tier-3 profile-conformance MedicationDispense.category.coding.where(code='outpatient' or code='community').exists() implies MedicationDispense.authorizingPrescription.exists() TT 26/2025/TT-BYT; QĐ 3176/QĐ-BYT Outpatient/retail dispensing must include authorizingPrescription
VN-RULE-MED-003 MedicationAdministration nên liên kết y lệnh (request) Sự kiện dùng thuốc nên trỏ về MedicationRequest để khép chuỗi y lệnh → cấp phát → sử dụng. Sửa: thêm MedicationAdministration.request. warning tier-3 profile-conformance MedicationAdministration should reference medication request order
VN-RULE-CLM-001 Claim phải có đúng 1 thẻ BHYT chính (focal=true) Một hồ sơ thanh toán có đúng 1 insurance.focal=true; thẻ bổ trợ dùng focal=false. Sửa: đánh dấu đúng thẻ chính. error tier-1 profile-conformance Claim.insurance.where(focal=true).count() = 1 QĐ 697/QĐ-BYT; NĐ 188/2025/NĐ-CP Đ22 Claim must have exactly one primary health insurance card (focal=true)
VN-RULE-CLM-014 Số ngày giường phải khớp số ngày nằm viện Số lượng item nhóm chi phí ngày giường (cost-category 2.2) phải khớp số ngày Encounter.period.end − period.start. Kiểm tra phía server. error tier-2 legal-business-rule QĐ 697/QĐ-BYT Number of bed-days must match length of stay
VN-RULE-BHYT-001 Thiếu SO_CCCD nhưng không có mã lý do bất khả kháng Khi xuất dữ liệu BHXH (QĐ 3176), SO_CCCD bắt buộc; nếu trống phải có Patient.extension[force-majeure-reason]. Kiểm tra phía server/gateway. error tier-2 normative-data-standard QĐ 3176/QĐ-BYT Missing SO_CCCD without exemption reason code
VN-RULE-BHYT-002 MA_LK phải nhất quán trên toàn bộ hồ sơ gửi MA_LK là khóa liên kết hồ sơ một đợt KCB; Claim.identifier[MALK] và Bundle.identifier phải cùng giá trị cho mọi resource liên quan. Kiểm tra phía server. error tier-2 normative-data-standard QĐ 3176/QĐ-BYT MA_LK must be consistent across all submitted records
VN-RULE-BHYT-003 Ngày giờ xuất cổng BHXH phải theo định dạng yyyyMMddHHmm Trường ngày giờ xuất/gateway (NGAY_VAO, NGAY_RA, NGAY_YL...) phải đúng yyyyMMddHHmm ở lớp export. Kiểm tra phía server/gateway. error tier-2 normative-data-standard QĐ 3176/QĐ-BYT BHXH discharge timestamp must follow format yyyyMMddHHmm
VN-RULE-BDL-001 Mỗi entry trong transaction Bundle phải có request.method và request.url Bundle.type=transaction yêu cầu mỗi entry có request.method + request.url (FHIR bdl-3). Sửa: bổ sung request cho mọi entry. error tier-1 profile-conformance Bundle.where(type='transaction').entry.all(request.method.exists() and request.url.exists()) FHIR R4 bdl-3; NĐ 164/2025/NĐ-CP Each entry in a transaction Bundle must have request.method and request.url
VN-RULE-TERM-001 Mã không thuộc ValueSet có binding required Mã coding không nằm trong ValueSet ràng buộc required của phần tử. Sửa: dùng mã hợp lệ từ ValueSet (vd ICD-10 VN, nhóm chi phí QĐ 697). error tier-1 normative-data-standard Code not in required-bound ValueSet

Mô tả các bảng ở trên.