| Code | Display | Definition | severity | tier | category | expression | invariant | legalBasis | severity | tier | category | expression | invariant | legalBasis | English (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, error | tier-1, tier-1 | normative-data-standard, normative-data-standard | Patient.identifier.where(system='.../sid/cccd').value.matches('[0-9]{12}'), Patient.identifier.where(system='.../sid/cccd').value.matches('[0-9]{12}') | vn-cccd-format, vn-cccd-format | Luật Căn cước 2023 Điều 20, Luật Căn cước 2023 Điều 20 | error, error | tier-1, tier-1 | normative-data-standard, normative-data-standard | Patient.identifier.where(system='.../sid/cccd').value.matches('[0-9]{12}'), Patient.identifier.where(system='.../sid/cccd').value.matches('[0-9]{12}') | vn-cccd-format, vn-cccd-format | Luật Căn cước 2023 Điều 20, 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, warning | tier-2, tier-2 | technical-quality-guardrail, technical-quality-guardrail | | | Luật Căn cước 2023, Luật Căn cước 2023 | warning, warning | tier-2, tier-2 | technical-quality-guardrail, technical-quality-guardrail | | | Luật Căn cước 2023, 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, error | tier-2, tier-2 | normative-data-standard, normative-data-standard | | | QĐ 19/2025/QĐ-TTg; NQ 202/2025/QH15, QĐ 19/2025/QĐ-TTg; NQ 202/2025/QH15 | error, error | tier-2, tier-2 | normative-data-standard, normative-data-standard | | | QĐ 19/2025/QĐ-TTg; NQ 202/2025/QH15, 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, information | tier-3, tier-3 | profile-conformance, profile-conformance | | | QĐ 01/2008/QĐ-BYT (cấp cứu xử trí trước), QĐ 01/2008/QĐ-BYT (cấp cứu xử trí trước) | information, information | tier-3, tier-3 | profile-conformance, profile-conformance | | | QĐ 01/2008/QĐ-BYT (cấp cứu xử trí trước), 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, error | tier-2, tier-2 | profile-conformance, profile-conformance | | | | error, error | tier-2, tier-2 | profile-conformance, 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, warning | tier-1, tier-1 | profile-conformance, profile-conformance | | vn-addr-province, vn-addr-province | | warning, warning | tier-1, tier-1 | profile-conformance, profile-conformance | | vn-addr-province, 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, error | tier-1, tier-1 | profile-conformance, profile-conformance | Encounter.serviceProvider.exists(), Encounter.serviceProvider.exists() | | QĐ 3176/QĐ-BYT, QĐ 3176/QĐ-BYT | error, error | tier-1, tier-1 | profile-conformance, profile-conformance | Encounter.serviceProvider.exists(), Encounter.serviceProvider.exists() | | QĐ 3176/QĐ-BYT, 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, warning | tier-3, tier-3 | technical-quality-guardrail, technical-quality-guardrail | | | | warning, warning | tier-3, tier-3 | technical-quality-guardrail, 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, warning | tier-3, tier-3 | profile-conformance, profile-conformance | | | | warning, warning | tier-3, tier-3 | profile-conformance, 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, error | tier-3, tier-3 | profile-conformance, profile-conformance | MedicationDispense.category.coding.where(code='outpatient' or code='community').exists() implies MedicationDispense.authorizingPrescription.exists(), MedicationDispense.category.coding.where(code='outpatient' or code='community').exists() implies MedicationDispense.authorizingPrescription.exists() | | TT 26/2025/TT-BYT; QĐ 3176/QĐ-BYT, TT 26/2025/TT-BYT; QĐ 3176/QĐ-BYT | error, error | tier-3, tier-3 | profile-conformance, profile-conformance | MedicationDispense.category.coding.where(code='outpatient' or code='community').exists() implies MedicationDispense.authorizingPrescription.exists(), MedicationDispense.category.coding.where(code='outpatient' or code='community').exists() implies MedicationDispense.authorizingPrescription.exists() | | TT 26/2025/TT-BYT; QĐ 3176/QĐ-BYT, 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, warning | tier-3, tier-3 | profile-conformance, profile-conformance | | | | warning, warning | tier-3, tier-3 | profile-conformance, 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, error | tier-1, tier-1 | profile-conformance, profile-conformance | Claim.insurance.where(focal=true).count() = 1, Claim.insurance.where(focal=true).count() = 1 | | QĐ 697/QĐ-BYT; NĐ 188/2025/NĐ-CP Đ22, QĐ 697/QĐ-BYT; NĐ 188/2025/NĐ-CP Đ22 | error, error | tier-1, tier-1 | profile-conformance, profile-conformance | Claim.insurance.where(focal=true).count() = 1, Claim.insurance.where(focal=true).count() = 1 | | QĐ 697/QĐ-BYT; NĐ 188/2025/NĐ-CP Đ22, 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, error | tier-2, tier-2 | legal-business-rule, legal-business-rule | | | QĐ 697/QĐ-BYT, QĐ 697/QĐ-BYT | error, error | tier-2, tier-2 | legal-business-rule, legal-business-rule | | | QĐ 697/QĐ-BYT, 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/QĐ-BYT), 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, error | tier-2, tier-2 | normative-data-standard, normative-data-standard | | | QĐ 3176/QĐ-BYT, QĐ 3176/QĐ-BYT | error, error | tier-2, tier-2 | normative-data-standard, normative-data-standard | | | QĐ 3176/QĐ-BYT, 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, error | tier-2, tier-2 | normative-data-standard, normative-data-standard | | | QĐ 3176/QĐ-BYT, QĐ 3176/QĐ-BYT | error, error | tier-2, tier-2 | normative-data-standard, normative-data-standard | | | QĐ 3176/QĐ-BYT, 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, error | tier-2, tier-2 | normative-data-standard, normative-data-standard | | | QĐ 3176/QĐ-BYT, QĐ 3176/QĐ-BYT | error, error | tier-2, tier-2 | normative-data-standard, normative-data-standard | | | QĐ 3176/QĐ-BYT, 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, error | tier-1, tier-1 | profile-conformance, profile-conformance | Bundle.where(type='transaction').entry.all(request.method.exists() and request.url.exists()), Bundle.where(type='transaction').entry.all(request.method.exists() and request.url.exists()) | | FHIR R4 bdl-3; NĐ 164/2025/NĐ-CP, FHIR R4 bdl-3; NĐ 164/2025/NĐ-CP | error, error | tier-1, tier-1 | profile-conformance, profile-conformance | Bundle.where(type='transaction').entry.all(request.method.exists() and request.url.exists()), Bundle.where(type='transaction').entry.all(request.method.exists() and request.url.exists()) | | FHIR R4 bdl-3; NĐ 164/2025/NĐ-CP, 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/QĐ-BYT). | error, error | tier-1, tier-1 | normative-data-standard, normative-data-standard | | | | error, error | tier-1, tier-1 | normative-data-standard, normative-data-standard | | | | Code not in required-bound ValueSet |