Skip to content

← All contracts

OHN-34 Data Quality and Stewardship API

Version
1.0.1
OpenAPI
3.1.0
Source in the repository
modules/OHN-34/api/openapi.yaml
Servers
https://opeshealthnetwork.com
Authentication
bearer: http bearer (JWT)

Download the contract (YAML)

Contracts are written in English.

Accountable human workflows for incomplete, contradictory, disputed and low-quality registry or clinical data. Every protected call needs a bearer token (a gateway-issued ES256 token: issuer ohn-platform-gateway, audience ohn-34; the purpose and organization_id are claims), a permitted purpose, the local default-deny role matrix and an OHN-16 policy permit. Every POST needs an Idempotency-Key (same key + same body replays the original response with `Idempotent-Replay: true`; same key + other body is 409). Tenancy (jurisdiction, organisation) always comes from the token, never from the request body.

Operations

rules

W003 quality rule deployment and F001

GET/api/ohn/v1/stewardship/vocabulariesControlled lists, workflow state machines and effective policy

Authentication: bearer

Responses

CodeDescriptionMedia type
200Vocabularies—
401Missing or invalid token
application/json: Error
403Denied by role
application/json: Error
GET/api/ohn/v1/stewardship/rulesList quality rules

Authentication: bearer

Parameters

NameInTypeRequiredDescription
statusqueryRuleStateno
entity_typequeryEntityTypeno
in_forcequery"true"no
pagequeryintegerno
page_sizequeryintegerno

Responses

CodeDescriptionMedia type
200Page of rules
application/json: Page
422Domain validation failed
application/json: Error
POST/api/ohn/v1/stewardship/rulesOHN-34-F001 Data quality rule configuration (creates a draft)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201Draft created
application/json: QualityRuleView
403Denied by role
application/json: Error
409Stale version
application/json: Error
422Domain validation failed
application/json: Error
GET/api/ohn/v1/stewardship/rules/{id}

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200Rule with history—
404Not found or non-disclosing refusal
application/json: Error
POST/api/ohn/v1/stewardship/rules/{id}/transitionsW003 draft → sample_benchmarked → reviewed → approved → active

sample_benchmarked (data_steward, needs `sample`), reviewed (clinical_reviewer, not the author), approved (data_steward, not the author; a `quarantine` rule also needs OHN34_MAX_QUARANTINE_FAILURE_RATE configured and a benchmark failure rate at or below it), active (data_steward; retires the earlier active version of the same rule key).

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Transitioned
application/json: QualityRuleView
403Denied by role
application/json: Error
409Stale version
application/json: Error
422Domain validation failed
application/json: Error
503Dependency unavailable or not configured; nothing accepted or fabricated
application/json: Error

evaluations

W001 data quality evaluation

GET/api/ohn/v1/stewardship/evaluations

Authentication: bearer

Parameters

NameInTypeRequiredDescription
pagequeryintegerno
page_sizequeryintegerno

Responses

CodeDescriptionMedia type
200Page of evaluations—
POST/api/ohn/v1/stewardship/evaluationsW001 submit a record for evaluation (contract ohn34.record-evaluation v1.0.0; field values are never stored)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201Evaluated; disposition accepted—
422Domain validation failed
application/json: Error
503Dependency unavailable or not configured; nothing accepted or fabricated
application/json: Error
GET/api/ohn/v1/stewardship/evaluations/{id}

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200Evaluation with history—
404Not found or non-disclosing refusal
application/json: Error
GET/api/ohn/v1/stewardship/records/{recordRef}/dispositionWhether a record is held (quarantined) and how many open issues it has; record owners must honour it

Authentication: bearer

Parameters

NameInTypeRequiredDescription
recordRefpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200Disposition—
404Not found or non-disclosing refusal
application/json: Error
GET/api/ohn/v1/stewardship/issues

Authentication: bearer

Parameters

NameInTypeRequiredDescription
statusquery"open" | "resolved"no
severityquerySeverityno
without_casequery"true"no
pagequeryintegerno
page_sizequeryintegerno

Responses

CodeDescriptionMedia type
200Page of issues—
GET/api/ohn/v1/stewardship/issues/{id}

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200Issue—
404Not found or non-disclosing refusal
application/json: Error

cases

W002 stewardship case

GET/api/ohn/v1/stewardship/casesOHN-34-API-001 list stewardship cases (queues)

Operation ID: ohn-34_get_api-ohn-v1-stewardship-cases

Authentication: bearer

Parameters

NameInTypeRequiredDescription
statusqueryCaseStateno
priorityquerySeverityno
openquery"true"no
overduequery"true"no
assigned_to_mequery"true"no
awaiting_my_verificationquery"true"no
pagequeryintegerno
page_sizequeryintegerno

Responses

CodeDescriptionMedia type
200Page of cases
application/json: Page
401Missing or invalid token
application/json: Error
403Denied by role
application/json: Error
422Domain validation failed
application/json: Error
429Rate limited (Retry-After)
application/json: Error
503Dependency unavailable or not configured; nothing accepted or fabricated
application/json: Error
POST/api/ohn/v1/stewardship/casesOHN-34-F002 Stewardship case assignment (opens the case if needed; reassigns while `assigned`)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Assigned
application/json: CaseView
201Case opened and assigned—
404Not found or non-disclosing refusal
application/json: Error
409Stale version
application/json: Error
422Domain validation failed
application/json: Error
GET/api/ohn/v1/stewardship/cases/{id}Case with issue, rule, quarantine, remediation receipts, acknowledgements and history

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200Case detail—
404Not found or non-disclosing refusal
application/json: Error
POST/api/ohn/v1/stewardship/cases/{id}/transitionsW002 investigated (assignee) → verified (named clinical reviewer; approved or rejected → back to investigated) → closed (data steward)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Transitioned—
403Denied by role
application/json: Error
409Stale version
application/json: Error
422Domain validation failed
application/json: Error
POST/api/ohn/v1/stewardship/cases/{id}/resolveOHN-34-API-002 / F003 Quality resolution approval request (investigated → source_corrected)

Only the assignee; the named clinical approver must be someone else. OHN-34 never overwrites the source record.

Operation ID: ohn-34_post_api-ohn-v1-stewardship-cases-id-resolve

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Resolution recorded
application/json: CaseView
400Malformed request or missing Idempotency-Key
application/json: Error
401Missing or invalid token
application/json: Error
403Denied by role
application/json: Error
404Not found or non-disclosing refusal
application/json: Error
409Stale version
application/json: Error
422Domain validation failed
application/json: Error
429Rate limited (Retry-After)
application/json: Error
503Dependency unavailable or not configured; nothing accepted or fabricated
application/json: Error
POST/api/ohn/v1/stewardship/cases/{id}/acknowledgementsA named affected consumer (OHN-03, OHN-08) acknowledges a closed case's outcome

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Already acknowledged—
201Acknowledged—
409Stale version
application/json: Error

reports

R001-R003

GET/api/ohn/v1/stewardship/metricsOHN-34-API-003 governance metrics (counts only, no record references)

Operation ID: ohn-34_get_api-ohn-v1-stewardship-metrics

Authentication: bearer

Responses

CodeDescriptionMedia type
200Metrics—
401Missing or invalid token
application/json: Error
403Denied by role
application/json: Error
503Dependency unavailable or not configured; nothing accepted or fabricated
application/json: Error
GET/api/ohn/v1/stewardship/signoffsSign-off history (rule reviews/approvals/activations; case resolutions, verifications, rejections, closures)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
pagequeryintegerno
page_sizequeryintegerno

Responses

CodeDescriptionMedia type
200Page of sign-offs—
GET/api/ohn/v1/stewardship/reports/{reportId}Run R001 (filters facility, from, to), R002 (severity, source, min_age_days) or R003 (source, from, to)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
reportIdpath"OHN-34-R001" | "OHN-34-R002" | "OHN-34-R003"yes
facilityquerystring (uuid)noR001 only
fromquerystringnoR001 and R003: ISO date or date-time
toquerystringnoR001 and R003: ISO date or date-time, exclusive
severityquerySeveritynoR002 only
sourcequerystring (uuid)noR002 and R003
min_age_daysqueryintegernoR002 only: whole days 0 to 3650

Responses

CodeDescriptionMedia type
200Tabular report with definition—
404Not found or non-disclosing refusal
application/json: Error
422Domain validation failed
application/json: Error
POST/api/ohn/v1/stewardship/reports/{reportId}/exportAudited CSV/PDF export signed with HMAC-SHA256 (503 not_configured without an export signing key of 32 or more characters); link valid 15 minutes

Authentication: bearer

Parameters

NameInTypeRequiredDescription
reportIdpath"OHN-34-R001" | "OHN-34-R002" | "OHN-34-R003"yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201Export receipt with download_path—
503Dependency unavailable or not configured; nothing accepted or fabricated
application/json: Error
GET/api/ohn/v1/stewardship/exports/{id}/downloadDownload an export; only its creator, in the same jurisdiction, before expiry (410 after)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200File—
404Not found or non-disclosing refusal
application/json: Error
410Expired—

Other operations

GET/health/ohn-34Module health (database reachable, dependency adapter modes)

Responses

CodeDescriptionMedia type
200Healthy
application/json: Health
503Database unreachable
application/json: Health

Schemas

Error

NameTypeRequiredDescription
errorstringyes
messagestringno
fieldsobjectno
current_statestringno
current_versionintegerno
dependencystringno
next_statestring | nullnoinvalid_transition: the only state the aggregate can move to
failure_ratenumber | nullnobenchmark_failure_rate_too_high
limitnumbernobenchmark_failure_rate_too_high: the configured maximum
case_idstring (uuid)nocase_in_progress
detailsobjectnoA 422 from the strict body reader: the first failing check per top-level field as a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value, invalid_union), unknown keys under _ as unrecognized_keys; a failing report filter or query value under its name as its message.
typestringnoPlatform problem+json (RFC 9457) fields next to the reference ones
titlestringno
statusintegerno
detailstringno
trace_idstringno

Health

NameTypeRequiredDescription
status"ok" | "unavailable"no
module"OHN-34"no
versionstringno
synthetic_gatewaysbooleannotrue only when the synthetic OHN-16 and OHN-23 doubles are switched on (never in production)
dependenciesobjectnoOHN-16 and OHN-23: synthetic, unconfigured or live; OHN-03 and OHN-08: inbound-contract; OHN-18: local-audit

Page

NameTypeRequiredDescription
itemsarray of anyyes
totalintegeryes
pageintegeryes
page_sizeintegeryes
provenanceProvenanceno

Provenance

NameTypeRequiredDescription
sourcestringno
source_versionstringno
generated_atstring (date-time)no
dependency_adaptersobjectno

Receipt

NameTypeRequiredDescription
receipt_idstring (uuid)no
committed_atstring (date-time)no
aggregate_idstringno
aggregate_typestringno
versionintegerno
status"committed"no
event_delivery"pending" | "not_applicable"no
event_idstring | nullno

EntityType

"patient_identity" | "clinical_statement" | "facility" | "health_worker"

Severity

"low" | "moderate" | "high" | "critical"

FailureAction

"flag" | "open_case" | "quarantine"

RuleState

"draft" | "sample_benchmarked" | "reviewed" | "approved" | "active"

CaseState

"issue_detected" | "assigned" | "investigated" | "source_corrected" | "verified" | "closed"

QualityRuleCommand

NameTypeRequiredDescription
entity_typeEntityTypeyes
field_or_rulestringyesA field name, or JSON {"kind":"required|one_of|not_future|code_valid","field":...}
severitySeverityyes
jurisdiction_idstring (uuid)yesMust equal the token jurisdiction (403 otherwise)
rule_versionstringyes
action_on_failureFailureActionyes

QualityRuleView

NameTypeRequiredDescription
idstring (uuid)no
rule_keystringno
definitionobjectno
statusRuleStateno
next_statestring | nullno
benchmarkQualityRuleView.benchmarkno
in_forcebooleanno
versionintegerno
receiptReceiptno

RuleTransitionCommand

NameTypeRequiredDescription
expected_versionintegeryes
to_stateRuleStateyes
reasonstringno
samplearray of objectno

EvaluationCommand

NameTypeRequiredDescription
entity_typeEntityTypeyes
record_refstring (uuid)yes
source_system_idstring (uuid)yes
facility_idstring (uuid)no
fieldsobjectyes

CaseAssignmentCommand

NameTypeRequiredDescription
issue_refstring (uuid)yes
assignee_idstring (uuid)yes
prioritySeverityyes
resolution_due_atstring (date-time)yesMust be in the future
resolution_planstringyes

CaseTransitionCommand

NameTypeRequiredDescription
expected_versionintegeryes
to_state"investigated" | "verified" | "closed"yes
findingsstringno
decision"approved" | "rejected"no
reasonstringno
affected_consumersarray of "OHN-03" | "OHN-08"no

ResolutionCommand

NameTypeRequiredDescription
case_idstring (uuid)yes
source_evidence_refstring (uuid)yes
proposed_resolutionstringyes
clinical_approverstring (uuid)yes
decision"corrected_at_source" | "disputed" | "no_change_required"yes
expected_versionintegeryes

CaseView

NameTypeRequiredDescription
idstring (uuid)no
statusCaseStateno
next_statestring | nullno
assignee_idstring | nullno
prioritystring | nullno
resolution_due_atstring | null (date-time)no
overduebooleanno
decisionstring | nullno
clinical_approverstring | nullno
rejectionsintegerno
affected_consumersarray of stringno
versionintegerno
receiptReceiptno

post-api-ohn-v1-stewardship-cases-id-acknowledgements.request defined inline

NameTypeRequiredDescription
consumer"OHN-03" | "OHN-08"yes

post-api-ohn-v1-stewardship-reports-reportid-export.request defined inline

NameTypeRequiredDescription
format"csv" | "pdf"yes
filtersobjectnoOnly the filters of the report; any other key is 422

QualityRuleView.benchmark defined inline

NameTypeRequiredDescription
sample_sizeintegerno
failedintegerno
failure_ratenumberno