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)
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 (5)
- evaluations (6)
- cases (6)
- reports (5)
- Other operations (1)
rules
W003 quality rule deployment and F001
GET/api/ohn/v1/stewardship/vocabulariesControlled lists, workflow state machines and effective policy
GET/api/ohn/v1/stewardship/rulesList quality rules
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
status | query | RuleState | no | |
entity_type | query | EntityType | no | |
in_force | query | "true" | no | |
page | query | integer | no | |
page_size | query | integer | no |
Responses
POST/api/ohn/v1/stewardship/rulesOHN-34-F001 Data quality rule configuration (creates a draft)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes |
Request body (required)
application/json:QualityRuleCommand
Responses
| Code | Description | Media type |
|---|---|---|
201 | Draft created | application/json: QualityRuleView |
403 | Denied by role | application/json: Error |
409 | Stale version | application/json: Error |
422 | Domain validation failed | application/json: Error |
GET/api/ohn/v1/stewardship/rules/{id}
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Rule with history | — |
404 | Not 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:RuleTransitionCommand
Responses
| Code | Description | Media type |
|---|---|---|
200 | Transitioned | application/json: QualityRuleView |
403 | Denied by role | application/json: Error |
409 | Stale version | application/json: Error |
422 | Domain validation failed | application/json: Error |
503 | Dependency 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
page | query | integer | no | |
page_size | query | integer | no |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Page 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes |
Request body (required)
application/json:EvaluationCommand
Responses
GET/api/ohn/v1/stewardship/evaluations/{id}
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Evaluation with history | — |
404 | Not 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
recordRef | path | string (uuid) | yes |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Disposition | — |
404 | Not found or non-disclosing refusal | application/json: Error |
GET/api/ohn/v1/stewardship/issues
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
status | query | "open" | "resolved" | no | |
severity | query | Severity | no | |
without_case | query | "true" | no | |
page | query | integer | no | |
page_size | query | integer | no |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Page of issues | — |
GET/api/ohn/v1/stewardship/issues/{id}
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Issue | — |
404 | Not 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
status | query | CaseState | no | |
priority | query | Severity | no | |
open | query | "true" | no | |
overdue | query | "true" | no | |
assigned_to_me | query | "true" | no | |
awaiting_my_verification | query | "true" | no | |
page | query | integer | no | |
page_size | query | integer | no |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Page of cases | application/json: Page |
401 | Missing or invalid token | application/json: Error |
403 | Denied by role | application/json: Error |
422 | Domain validation failed | application/json: Error |
429 | Rate limited (Retry-After) | application/json: Error |
503 | Dependency 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes |
Request body (required)
application/json:CaseAssignmentCommand
Responses
GET/api/ohn/v1/stewardship/cases/{id}Case with issue, rule, quarantine, remediation receipts, acknowledgements and history
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Case detail | — |
404 | Not 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:CaseTransitionCommand
Responses
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:ResolutionCommand
Responses
| Code | Description | Media type |
|---|---|---|
200 | Resolution recorded | application/json: CaseView |
400 | Malformed request or missing Idempotency-Key | application/json: Error |
401 | Missing or invalid token | application/json: Error |
403 | Denied by role | application/json: Error |
404 | Not found or non-disclosing refusal | application/json: Error |
409 | Stale version | application/json: Error |
422 | Domain validation failed | application/json: Error |
429 | Rate limited (Retry-After) | application/json: Error |
503 | Dependency 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:post-api-ohn-v1-stewardship-cases-id-acknowledgements.request
Responses
| Code | Description | Media type |
|---|---|---|
200 | Already acknowledged | — |
201 | Acknowledged | — |
409 | Stale 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
GET/api/ohn/v1/stewardship/signoffsSign-off history (rule reviews/approvals/activations; case resolutions, verifications, rejections, closures)
Authentication: bearer
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
page | query | integer | no | |
page_size | query | integer | no |
Responses
| Code | Description | Media type |
|---|---|---|
200 | Page 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
reportId | path | "OHN-34-R001" | "OHN-34-R002" | "OHN-34-R003" | yes | |
facility | query | string (uuid) | no | R001 only |
from | query | string | no | R001 and R003: ISO date or date-time |
to | query | string | no | R001 and R003: ISO date or date-time, exclusive |
severity | query | Severity | no | R002 only |
source | query | string (uuid) | no | R002 and R003 |
min_age_days | query | integer | no | R002 only: whole days 0 to 3650 |
Responses
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
reportId | path | "OHN-34-R001" | "OHN-34-R002" | "OHN-34-R003" | yes | |
Idempotency-Key | header | string | yes |
Request body (required)
application/json:post-api-ohn-v1-stewardship-reports-reportid-export.request
Responses
| Code | Description | Media type |
|---|---|---|
201 | Export receipt with download_path | — |
503 | Dependency 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes |
Responses
| Code | Description | Media type |
|---|---|---|
200 | File | — |
404 | Not found or non-disclosing refusal | application/json: Error |
410 | Expired | — |
Other operations
Schemas
Error
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes | |
message | string | no | |
fields | object | no | |
current_state | string | no | |
current_version | integer | no | |
dependency | string | no | |
next_state | string | null | no | invalid_transition: the only state the aggregate can move to |
failure_rate | number | null | no | benchmark_failure_rate_too_high |
limit | number | no | benchmark_failure_rate_too_high: the configured maximum |
case_id | string (uuid) | no | case_in_progress |
details | object | no | A 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. |
type | string | no | Platform problem+json (RFC 9457) fields next to the reference ones |
title | string | no | |
status | integer | no | |
detail | string | no | |
trace_id | string | no |
Health
| Name | Type | Required | Description |
|---|---|---|---|
status | "ok" | "unavailable" | no | |
module | "OHN-34" | no | |
version | string | no | |
synthetic_gateways | boolean | no | true only when the synthetic OHN-16 and OHN-23 doubles are switched on (never in production) |
dependencies | object | no | OHN-16 and OHN-23: synthetic, unconfigured or live; OHN-03 and OHN-08: inbound-contract; OHN-18: local-audit |
Page
| Name | Type | Required | Description |
|---|---|---|---|
items | array of any | yes | |
total | integer | yes | |
page | integer | yes | |
page_size | integer | yes | |
provenance | Provenance | no |
Provenance
| Name | Type | Required | Description |
|---|---|---|---|
source | string | no | |
source_version | string | no | |
generated_at | string (date-time) | no | |
dependency_adapters | object | no |
Receipt
| Name | Type | Required | Description |
|---|---|---|---|
receipt_id | string (uuid) | no | |
committed_at | string (date-time) | no | |
aggregate_id | string | no | |
aggregate_type | string | no | |
version | integer | no | |
status | "committed" | no | |
event_delivery | "pending" | "not_applicable" | no | |
event_id | string | null | no |
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
| Name | Type | Required | Description |
|---|---|---|---|
entity_type | EntityType | yes | |
field_or_rule | string | yes | A field name, or JSON {"kind":"required|one_of|not_future|code_valid","field":...} |
severity | Severity | yes | |
jurisdiction_id | string (uuid) | yes | Must equal the token jurisdiction (403 otherwise) |
rule_version | string | yes | |
action_on_failure | FailureAction | yes |
QualityRuleView
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | no | |
rule_key | string | no | |
definition | object | no | |
status | RuleState | no | |
next_state | string | null | no | |
benchmark | QualityRuleView.benchmark | no | |
in_force | boolean | no | |
version | integer | no | |
receipt | Receipt | no |
RuleTransitionCommand
| Name | Type | Required | Description |
|---|---|---|---|
expected_version | integer | yes | |
to_state | RuleState | yes | |
reason | string | no | |
sample | array of object | no |
EvaluationCommand
| Name | Type | Required | Description |
|---|---|---|---|
entity_type | EntityType | yes | |
record_ref | string (uuid) | yes | |
source_system_id | string (uuid) | yes | |
facility_id | string (uuid) | no | |
fields | object | yes |
CaseAssignmentCommand
| Name | Type | Required | Description |
|---|---|---|---|
issue_ref | string (uuid) | yes | |
assignee_id | string (uuid) | yes | |
priority | Severity | yes | |
resolution_due_at | string (date-time) | yes | Must be in the future |
resolution_plan | string | yes |
CaseTransitionCommand
| Name | Type | Required | Description |
|---|---|---|---|
expected_version | integer | yes | |
to_state | "investigated" | "verified" | "closed" | yes | |
findings | string | no | |
decision | "approved" | "rejected" | no | |
reason | string | no | |
affected_consumers | array of "OHN-03" | "OHN-08" | no |
ResolutionCommand
| Name | Type | Required | Description |
|---|---|---|---|
case_id | string (uuid) | yes | |
source_evidence_ref | string (uuid) | yes | |
proposed_resolution | string | yes | |
clinical_approver | string (uuid) | yes | |
decision | "corrected_at_source" | "disputed" | "no_change_required" | yes | |
expected_version | integer | yes |
CaseView
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | no | |
status | CaseState | no | |
next_state | string | null | no | |
assignee_id | string | null | no | |
priority | string | null | no | |
resolution_due_at | string | null (date-time) | no | |
overdue | boolean | no | |
decision | string | null | no | |
clinical_approver | string | null | no | |
rejections | integer | no | |
affected_consumers | array of string | no | |
version | integer | no | |
receipt | Receipt | no |
post-api-ohn-v1-stewardship-cases-id-acknowledgements.request defined inline
| Name | Type | Required | Description |
|---|---|---|---|
consumer | "OHN-03" | "OHN-08" | yes |
post-api-ohn-v1-stewardship-reports-reportid-export.request defined inline
| Name | Type | Required | Description |
|---|---|---|---|
format | "csv" | "pdf" | yes | |
filters | object | no | Only the filters of the report; any other key is 422 |
QualityRuleView.benchmark defined inline
| Name | Type | Required | Description |
|---|---|---|---|
sample_size | integer | no | |
failed | integer | no | |
failure_rate | number | no |