Intersection of http://fhir.hl7.org.vn/core/CodeSystem/vn-validation-rule-cs and http://fhir.hl7.org.vn/core/CodeSystem/vn-validation-rule-cs

This is the CodeSystem that contains codes in both Registry quy tắc kiểm tra hợp lệ VN Core — VN Core Validation Rule Registry (http://fhir.hl7.org.vn/core/CodeSystem/vn-validation-rule-cs) and Registry quy tắc kiểm tra hợp lệ VN Core — VN Core Validation Rule Registry (http://fhir.hl7.org.vn/core/CodeSystem/vn-validation-rule-cs).

Structure

Generated Narrative: CodeSystem 9bc2c52c-18f3-4420-b258-7934d913ee46-423

Properties

This code system defines the following properties for its concepts

NameCodeURITypeDescription
severityseverityhttp://fhir.hl7.org.vn/core/CodeSystem/vn-validation-rule-cs#severitystringMức độ trả về trong OperationOutcome: error | warning | information
tiertierhttp://fhir.hl7.org.vn/core/CodeSystem/vn-validation-rule-cs#tierstringTầng kiểm tra: tier-1 (FHIRPath invariant), tier-2 (server-side), tier-3 (business rule)
categorycategoryhttp://fhir.hl7.org.vn/core/CodeSystem/vn-validation-rule-cs#categorystringPhân loại căn cứ: normative-data-standard | legal-business-rule | profile-conformance | technical-quality-guardrail | source-exception
expressionexpressionhttp://fhir.hl7.org.vn/core/CodeSystem/vn-validation-rule-cs#expressionstringBiểu thức FHIRPath hoặc tóm tắt quy tắc kiểm tra
invariantinvarianthttp://fhir.hl7.org.vn/core/CodeSystem/vn-validation-rule-cs#invariantstringTên FHIRPath invariant tương ứng trong profile (nếu là tier-1)
legalBasislegalBasishttp://fhir.hl7.org.vn/core/CodeSystem/vn-validation-rule-cs#legalBasisstringCăn cứ pháp lý/chuẩn dữ liệu cho quy tắc
severityseverityhttp://fhir.hl7.org.vn/core/CodeSystem/vn-validation-rule-cs#severitystringMức độ trả về trong OperationOutcome: error | warning | information
tiertierhttp://fhir.hl7.org.vn/core/CodeSystem/vn-validation-rule-cs#tierstringTầng kiểm tra: tier-1 (FHIRPath invariant), tier-2 (server-side), tier-3 (business rule)
categorycategoryhttp://fhir.hl7.org.vn/core/CodeSystem/vn-validation-rule-cs#categorystringPhân loại căn cứ: normative-data-standard | legal-business-rule | profile-conformance | technical-quality-guardrail | source-exception
expressionexpressionhttp://fhir.hl7.org.vn/core/CodeSystem/vn-validation-rule-cs#expressionstringBiểu thức FHIRPath hoặc tóm tắt quy tắc kiểm tra
invariantinvarianthttp://fhir.hl7.org.vn/core/CodeSystem/vn-validation-rule-cs#invariantstringTên FHIRPath invariant tương ứng trong profile (nếu là tier-1)
legalBasislegalBasishttp://fhir.hl7.org.vn/core/CodeSystem/vn-validation-rule-cs#legalBasisstringCăn cứ pháp lý/chuẩn dữ liệu cho quy tắc

Concepts

This code system http://hl7.org/fhir/comparison/CodeSystem/9bc2c52c-18f3-4420-b258-7934d913ee46-423 defines codes, but no codes are represented here

CodeDisplayDefinitionseveritytiercategoryexpressioninvariantlegalBasisseveritytiercategoryexpressioninvariantlegalBasisEnglish (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, errortier-1, tier-1normative-data-standard, normative-data-standardPatient.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-formatLuật Căn cước 2023 Điều 20, Luật Căn cước 2023 Điều 20error, errortier-1, tier-1normative-data-standard, normative-data-standardPatient.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-formatLuật Căn cước 2023 Điều 20, Luật Căn cước 2023 Điều 20CCCD 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ínhChữ 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, warningtier-2, tier-2technical-quality-guardrail, technical-quality-guardrailLuật Căn cước 2023, Luật Căn cước 2023warning, warningtier-2, tier-2technical-quality-guardrail, technical-quality-guardrailLuật Căn cước 2023, Luật Căn cước 2023The 4th digit of CCCD does not match gender
VN-RULE-PAT-003 Mã xã/phường không thuộc tỉnh/TP đã chọnKhi 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, errortier-2, tier-2normative-data-standard, normative-data-standardQĐ 19/2025/QĐ-TTg; NQ 202/2025/QH15, QĐ 19/2025/QĐ-TTg; NQ 202/2025/QH15error, errortier-2, tier-2normative-data-standard, normative-data-standardQĐ 19/2025/QĐ-TTg; NQ 202/2025/QH15, QĐ 19/2025/QĐ-TTg; NQ 202/2025/QH15Commune/ward code is not within selected province/city
VN-RULE-PAT-004 Cấp cứu: cho phép Patient chỉ có identifier tạmTrong 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, informationtier-3, tier-3profile-conformance, profile-conformanceQĐ 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, informationtier-3, tier-3profile-conformance, profile-conformanceQĐ 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ùngKhi 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, errortier-2, tier-2profile-conformance, profile-conformanceerror, errortier-2, tier-2profile-conformance, profile-conformanceRecord 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, warningtier-1, tier-1profile-conformance, profile-conformancevn-addr-province, vn-addr-provincewarning, warningtier-1, tier-1profile-conformance, profile-conformancevn-addr-province, vn-addr-provinceVietnam address must include extension:province
VN-RULE-ENC-001 Encounter.serviceProvider là bắt buộcLượ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, errortier-1, tier-1profile-conformance, profile-conformanceEncounter.serviceProvider.exists(), Encounter.serviceProvider.exists()QĐ 3176/QĐ-BYT, QĐ 3176/QĐ-BYTerror, errortier-1, tier-1profile-conformance, profile-conformanceEncounter.serviceProvider.exists(), Encounter.serviceProvider.exists()QĐ 3176/QĐ-BYT, QĐ 3176/QĐ-BYTEncounter.serviceProvider is required
VN-RULE-ENC-002 Encounter.period không được chồng lấn cho cùng bệnh nhânTrừ 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, warningtier-3, tier-3technical-quality-guardrail, technical-quality-guardrailwarning, warningtier-3, tier-3technical-quality-guardrail, technical-quality-guardrailEncounter.period must not overlap for the same patient
VN-RULE-CON-001 Mỗi Condition chỉ nên ghi 1 chẩn đoán1 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, warningtier-3, tier-3profile-conformance, profile-conformancewarning, warningtier-3, tier-3profile-conformance, profile-conformanceEach Condition should contain only one diagnosis
VN-RULE-MED-002 Cấp phát ngoại trú/bán lẻ phải có authorizingPrescriptionKhô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, errortier-3, tier-3profile-conformance, profile-conformanceMedicationDispense.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Đ-BYTerror, errortier-3, tier-3profile-conformance, profile-conformanceMedicationDispense.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Đ-BYTOutpatient/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, warningtier-3, tier-3profile-conformance, profile-conformancewarning, warningtier-3, tier-3profile-conformance, profile-conformanceMedicationAdministration 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, errortier-1, tier-1profile-conformance, profile-conformanceClaim.insurance.where(focal=true).count() = 1, Claim.insurance.where(focal=true).count() = 1QĐ 697/QĐ-BYT; NĐ 188/2025/NĐ-CP Đ22, QĐ 697/QĐ-BYT; NĐ 188/2025/NĐ-CP Đ22error, errortier-1, tier-1profile-conformance, profile-conformanceClaim.insurance.where(focal=true).count() = 1, Claim.insurance.where(focal=true).count() = 1QĐ 697/QĐ-BYT; NĐ 188/2025/NĐ-CP Đ22, QĐ 697/QĐ-BYT; NĐ 188/2025/NĐ-CP Đ22Claim 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ệnSố 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, errortier-2, tier-2legal-business-rule, legal-business-ruleQĐ 697/QĐ-BYT, QĐ 697/QĐ-BYTerror, errortier-2, tier-2legal-business-rule, legal-business-ruleQĐ 697/QĐ-BYT, QĐ 697/QĐ-BYTNumber 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ángKhi 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, errortier-2, tier-2normative-data-standard, normative-data-standardQĐ 3176/QĐ-BYT, QĐ 3176/QĐ-BYTerror, errortier-2, tier-2normative-data-standard, normative-data-standardQĐ 3176/QĐ-BYT, QĐ 3176/QĐ-BYTMissing 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ửiMA_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, errortier-2, tier-2normative-data-standard, normative-data-standardQĐ 3176/QĐ-BYT, QĐ 3176/QĐ-BYTerror, errortier-2, tier-2normative-data-standard, normative-data-standardQĐ 3176/QĐ-BYT, QĐ 3176/QĐ-BYTMA_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 yyyyMMddHHmmTrườ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, errortier-2, tier-2normative-data-standard, normative-data-standardQĐ 3176/QĐ-BYT, QĐ 3176/QĐ-BYTerror, errortier-2, tier-2normative-data-standard, normative-data-standardQĐ 3176/QĐ-BYT, QĐ 3176/QĐ-BYTBHXH discharge timestamp must follow format yyyyMMddHHmm
VN-RULE-BDL-001 Mỗi entry trong transaction Bundle phải có request.method và request.urlBundle.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, errortier-1, tier-1profile-conformance, profile-conformanceBundle.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Đ-CPerror, errortier-1, tier-1profile-conformance, profile-conformanceBundle.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Đ-CPEach entry in a transaction Bundle must have request.method and request.url
VN-RULE-TERM-001 Mã không thuộc ValueSet có binding requiredMã 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, errortier-1, tier-1normative-data-standard, normative-data-standarderror, errortier-1, tier-1normative-data-standard, normative-data-standardCode not in required-bound ValueSet