Starter contract

nhs_dsp_patient

16 rules · plain YAML · starts in observation mode

OpenDQV Cloud starter template (v0.1) — your tenant inherits this baseline. First customer edit creates v1.0 in your audit trail; pin by yaml_hash for replay. Healthcare patient record validation aligned with NHS Data Dictionary standards, Caldicott Principles for patient data handling, and NHS DSP Toolkit data quality obligations. Enforces ICD-10 diagnosis code format, NHS number Modulus 11 check-digit verification, blood group ABO/Rhesus classification, ONS/NHS 16+1 ethnicity classification, admission type and referral source taxonomy, and discharge date monotonicity (discharge must be on or after admission). Prevents misidentified patients, malformed diagnosis codes, and clinically invalid values from entering PAS (Patient Administration System), SUS+ (Secondary Uses Service), and MSDS (Maternity Services Data Set) pipelines.

These are starting points you own. Every rule below ships in the trial, starts in observation mode, and is yours to read, edit, or delete from day one. Rules that reference a lookup list (lookup_file) validate against reference data you control in your tenant.
Rules as at 29 August 2026 — starting points you own, not a maintained regulatory feed. We correct errors in these samples; tracking regulatory change in your active contracts is yours.
RuleFieldSeverityWhat it enforces (the message your team sees)
patient_id_requiredpatient_iderrorpatient_id is required
first_name_requiredfirst_nameerrorfirst_name is required
last_name_requiredlast_nameerrorlast_name is required
date_of_birth_formatdate_of_birtherrordate_of_birth must be a valid date (YYYY-MM-DD)
nhs_number_validnhs_numbererrornhs_number must be a valid 10-digit NHS number with a correct Modulus 11 check digit (e.g. 999 876 5439) — full check-digit verification (was: shape-only format check)
sex_valuessexerrorsex must be one of: male, female, indeterminate, unknown, not_stated (NHS Data Dictionary sex classification)
ethnicity_valuesethnicitywarningethnicity must be a valid ONS/NHS 16+1 ethnicity code — 'not_stated' must be recorded where patient declines (Equality Act 2010)
admission_date_formatadmission_dateerroradmission_date must be a valid date (YYYY-MM-DD)
admission_type_valuesadmission_typewarningadmission_type must be one of: elective, emergency, maternity, transfer, day_case, regular_attender, other (NHS HES admission method)
ward_requiredwarderrorward is required
diagnosis_code_requireddiagnosis_codeerrordiagnosis_code is required
diagnosis_code_formatdiagnosis_codeerrordiagnosis_code must be a valid ICD-10 code (e.g. A09, J45.0, Z00.00) — invalid codes are rejected by NHS SUS+ data warehouse
blood_type_formatblood_typeerrorblood_type must be a valid ABO/Rhesus blood group (e.g. A+, O-, AB+, B-) — incorrect blood group is an NHS Never Event
discharge_date_formatdischarge_datewarningdischarge_date must be a valid date (YYYY-MM-DD)
discharge_date_after_admissiondischarge_dateerrordischarge_date must be on or after admission_date — a discharge before admission corrupts Length of Stay reporting in NHS HES and SUS+
discharge_reason_valuesdischarge_reasonwarningdischarge_reason must be one of: clinical_discharge, transferred, self_discharge, against_medical_advice, died, still_admitted, other

Run your own data against this contract in the free trial — drop a CSV in the dashboard, no code, no credit card. Start free trial →