Conformance
Conformance levels
Section titled “Conformance levels”OVF defines two conformance levels.
OVF Core
Section titled “OVF Core”A conforming OVF Core document must satisfy all of the following:
- Contains
format_version,exported_at, andpatientat the top level - The
patientresource passes validation against the Patient schema - Contains at least one additional resource array (e.g.
encounters,conditions) with at least one valid entry
This is the minimum bar for a valid OVF document.
OVF Complete
Section titled “OVF Complete”A conforming OVF Complete document must satisfy all of the following:
- Meets all OVF Core requirements
- Contains all 9 resource types:
patient,encounters,conditions,observations,immunizations,procedures,allergies,medications,documents - Each resource array contains at least one valid entry
Validation
Section titled “Validation”The fastest way to validate:
npx ovf-validate my-record.jsonThe CLI reports the conformance level and any validation errors.
Programmatic (ajv)
Section titled “Programmatic (ajv)”See the Installation guide for full TypeScript and Python validation examples.
What gets validated
Section titled “What gets validated”- Schema validation: Each resource is checked against its JSON Schema (required fields, types, enum values, formats)
- Structural validation: The root document must have
format_version,exported_at, andpatient - Format checks: Date fields must be
YYYY-MM-DD, datetime fields must be ISO 8601
What is NOT validated
Section titled “What is NOT validated”- Referential integrity: The validator does not check that
patient_idvalues in child resources matchpatient.id - Business rules: Clinical validity (e.g. “encounter date must be after patient birth date”) is not enforced by the schema
- Extension content:
x_-prefixed fields are accepted but not validated
Valid vs invalid: examples
Section titled “Valid vs invalid: examples”Valid (OVF Core) — patient + one encounter:
{ "format_version": "1.0.0", "exported_at": "2026-03-30T12:00:00Z", "patient": { "resource_type": "Patient", "id": "pet-001", "name": "Burek", "species": "dog" }, "encounters": [ { "resource_type": "Encounter", "id": "enc-001", "patient_id": "pet-001", "status": "completed", "date": "2026-03-30T10:00:00Z" } ]}Invalid — missing species (required on Patient):
{ "format_version": "1.0.0", "exported_at": "2026-03-30T12:00:00Z", "patient": { "resource_type": "Patient", "id": "pet-001", "name": "Burek" }}Invalid — patient only, no resource arrays:
{ "format_version": "1.0.0", "exported_at": "2026-03-30T12:00:00Z", "patient": { "resource_type": "Patient", "id": "pet-001", "name": "Burek", "species": "dog" }}