Skip to content

← All contracts

OHN-57 Research, Insurance Analytics and Workforce Statistics

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

Download the contract (YAML)

Contracts are written in English.

Module key `research`. Every route except `GET /health/ohn-57` needs a gateway-issued Bearer token (ES256, issuer `ohn-platform-gateway`, audience `ohn-57`; subject, `jurisdiction` and `organization_id` are UUIDs) whose role uses its purpose of use (researcher/research, dac_member/research_governance, research_admin/research_administration, treating_clinician/treatment, insurer_analyst/insurance_analytics, fraud_reviewer/fraud_review, employer_analyst/workforce_statistics). Default deny: unknown route 404 (after authentication), role not listed 403 (audited), role used with another purpose 403. Every disclosure threshold (k, minimum cell, minimum group, maximum suppression) is configuration (`/config`, deployment defaults); nothing in the contract fixes one. Every write needs an `Idempotency-Key` header. Synthetic data only.

Operations

Other operations

GET/health/ohn-57Public liveness: status, module, dependencies (OHN-15, OHN-24, OHN-51: live or unconfigured), keys (pseudonym_key, link_key, export_signing_key: configured or not), writes_enabled, auth_configured, synthetic_auth (always false in Java), data (synthetic_only, or governed_release_only in production)

Responses

CodeDescriptionMedia type
200OK—
503Database unavailable—
GET/api/ohn/v1/research/contextRole

Authentication: bearer

Responses

CodeDescriptionMedia type
200OK—
GET/api/ohn/v1/research/configDisclosure configuration

Authentication: bearer

Responses

CodeDescriptionMedia type
200OK
application/json: Config
PUT/api/ohn/v1/research/configUpdate disclosure configuration (research_admin)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Saved—
409Error
application/json: Error
422Error
application/json: Error
GET/api/ohn/v1/research/studiesStudies (own organisation; committee sees all)

Authentication: bearer

Responses

CodeDescriptionMedia type
200OK—
POST/api/ohn/v1/research/studiesRegister a study with ethics evidence (researcher)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201Registered—
409Error
application/json: Error
422Invalid or ethics not current—
GET/api/ohn/v1/research/studies/{id}Study detail with requests

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200OK
application/json: Study
404Error
application/json: Error
POST/api/ohn/v1/research/studies/{id}/stateSuspend, reinstate or close (dac_member, research_admin)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Changed—
409Error
application/json: Error
POST/api/ohn/v1/research/studies/{id}/access-requestsAsk the data access committee (researcher)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201Submitted—
409Study not active or ethics not current—
GET/api/ohn/v1/research/access-requestsAccess requests with votes

Authentication: bearer

Parameters

NameInTypeRequiredDescription
statequery"submitted" | "approved" | "rejected" | "withdrawn"no

Responses

CodeDescriptionMedia type
200OK
POST/api/ohn/v1/research/access-requests/{id}/withdrawWithdraw a waiting request (researcher)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
200Withdrawn—
409Error
application/json: Error
POST/api/ohn/v1/research/access-requests/{id}/decisionsCommittee vote (dac_member). N distinct approvals approve; one rejection rejects; requester cannot vote.

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Recorded—
403Conflict of interest—
409Already decided or not waiting—
POST/api/ohn/v1/research/studies/{id}/extractsPrepare a de-identified k-anonymous extract (researcher, approved extract request)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201Released
403Not approved—
422empty_cohort or k_anonymity_not_reachable—
503Signing key not configured—
GET/api/ohn/v1/research/extracts/{id}/downloadSigned CSV (pid, generalised approved variables only)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200CSV
text/csv: string
409Study no longer active—
GET/api/ohn/v1/research/studies/{id}/workspace/queriesQuery log (append-only)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200OK—
POST/api/ohn/v1/research/studies/{id}/workspace/queriesAggregate-only workspace query over approved variables; logged

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Suppressed aggregates
403Not approved or variable not approved—
POST/api/ohn/v1/research/cohort-countsSuppressed feasibility count (researcher); logged

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Count
application/json: Published
GET/api/ohn/v1/research/trialsTrials

Authentication: bearer

Responses

CodeDescriptionMedia type
200OK—
POST/api/ohn/v1/research/trialsConfigure a trial (researcher, study registered with current approval)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201Draft created—
GET/api/ohn/v1/research/trials/{id}Trial with suppressed outcome counts

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200OK
application/json: Trial
POST/api/ohn/v1/research/trials/{id}/statedraft -> recruiting -> closed (researcher)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Changed—
409Error
application/json: Error
GET/api/ohn/v1/research/trials/{id}/eligibilityEligibility counts only (suppressed)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200OK
POST/api/ohn/v1/research/trials/{id}/contact-requestsRoute contact requests to treating clinicians for patients with OHN-15 research_contact permit (researcher)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

  • application/json: object

Responses

CodeDescriptionMedia type
200Suppressed counts
409Trial not recruiting—
503OHN-15 unavailable; nothing stored—
GET/api/ohn/v1/research/contact-requestsThe treating clinician's own contact requests (only place a patient is named)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
statequery"awaiting_clinician" | "contacted" | "patient_interested" | "patient_declined" | "not_appropriate" | "consent_withdrawn"no

Responses

CodeDescriptionMedia type
200OK
POST/api/ohn/v1/research/contact-requests/{id}/outcomeRecord contact outcome (treating_clinician); consent rechecked before 'contacted'

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Recorded—
409invalid_transition—
503OHN-15 unavailable—
GET/api/ohn/v1/research/fraud/rulesInsurer fraud rules

Authentication: bearer

Responses

CodeDescriptionMedia type
200OK—
PUT/api/ohn/v1/research/fraud/rulesCreate or update one rule (insurer_analyst)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Saved—
409Error
application/json: Error
422Error
application/json: Error
GET/api/ohn/v1/research/fraud/scansRecent scans

Authentication: bearer

Responses

CodeDescriptionMedia type
200OK—
POST/api/ohn/v1/research/fraud/scansScan the insurer's OHN-51 claims with enabled rules (insurer_analyst). Never changes a claim.

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

  • application/json: object

Responses

CodeDescriptionMedia type
200Scan result—
409No rules configured—
503OHN-51 unavailable—
GET/api/ohn/v1/research/fraud/flagsReviewer queue

Authentication: bearer

Parameters

NameInTypeRequiredDescription
statequery"open" | "under_review" | "cleared" | "referred_for_investigation"no
rule_typequery"duplicate_claim" | "impossible_volume" | "outlier_provider"no

Responses

CodeDescriptionMedia type
200OK
GET/api/ohn/v1/research/fraud/flags/{id}Flag with history

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200OK—
POST/api/ohn/v1/research/fraud/flags/{id}/transitionReview a flag (fraud_reviewer)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Changed—
409Error
application/json: Error
GET/api/ohn/v1/research/insights/population-riskAnonymous aggregates of the insurer's own members (insurer_analyst)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
dimensionquery"age_band" | "sex" | "region"no

Responses

CodeDescriptionMedia type
200OK
application/json: Aggregates
GET/api/ohn/v1/research/insights/workforceAnonymous workforce statistics for the employer's own workforce (employer_analyst)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
dimensionquery"age_band" | "sex" | "region"no

Responses

CodeDescriptionMedia type
200OK
application/json: Aggregates
POST/api/ohn/v1/research/mart/subjectsIngest synthetic subject records (research_admin)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Upserted—
POST/api/ohn/v1/research/admin/synthetic-loadGenerate synthetic subjects (research_admin, non-production only)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200Loaded—
404Not available in production or unless ohn.m57.synthetic-load-enabled is true—
GET/api/ohn/v1/research/mart/summaryData mart counts (dac_member

Authentication: bearer

Responses

CodeDescriptionMedia type
200OK—
GET/api/ohn/v1/research/auditAudit records (research_admin

Authentication: bearer

Responses

CodeDescriptionMedia type
200OK—
POST/api/ohn/v1/research/admin/outbox/relayRelay pending events to OHN-24 (research_admin)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Responses

CodeDescriptionMedia type
200Relay result—

Schemas

Error

NameTypeRequiredDescription
typestringno
titlestringno
statusintegerno
detailstringno
errorstringyes
messagestringno
trace_idstringno
settingstringno
dependencystringno
current_versionintegerno
k_requiredintegerno
receipt_idstring (uuid)no
detailsanynoFor a 422: 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_literal); unknown keys under _ as unrecognized_keys.

Receipt

NameTypeRequiredDescription
receipt_idstring (uuid)no
committed_atstring (date-time)no
aggregate_idstring | nullno
aggregate_typestringno
status"committed" | "denied" | "refused"no

Published

NameTypeRequiredDescription
countinteger | nullyes
suppressedbooleanyes
belowintegerno

Cell

NameTypeRequiredDescription
keyobjectyes
countinteger | nullyes
suppressedbooleanyes

Criteria

NameTypeRequiredDescription
sex"female" | "male" | "other" | "unknown"no
age_minintegerno
age_maxintegerno
regionsarray of stringno
conditions_anyarray of stringno
conditions_allarray of stringno
conditions_nonearray of stringno

SubjectRecord

NameTypeRequiredDescription
patient_idstring (uuid)yes
birth_yearintegeryes
sex"female" | "male" | "other" | "unknown"yes
regionstringyes
conditionsarray of stringyes
treating_clinician_idstring | null (uuid)yes
treating_org_idstring | null (uuid)yes
employer_org_idstring | null (uuid)yes
insurer_org_idstring | null (uuid)yes

Config

Disclosure thresholds of the jurisdiction. Until an administrator configures them (version 0, source default) the deployment defaults apply; if a default is not configured the answer is 503 not_configured and nothing is disclosed.

NameTypeRequiredDescription
k_anonymityintegeryes
min_cellintegeryes
insurer_min_cellintegeryes
employer_min_groupintegeryes
max_suppression_pctintegeryes
versionintegerno
source"configured" | "default"no

Study

NameTypeRequiredDescription
idstring (uuid)no
titlestringno
summarystringno
state"registered" | "suspended" | "closed"no
ethics_committeestringno
ethics_referencestringno
ethics_approved_onstring (date)no
ethics_expires_onstring (date)no
ethics_evidence_refstringno
ethics_evidence_sha256stringno
ethics_currentbooleanno
versionintegerno

AccessRequest

NameTypeRequiredDescription
idstring (uuid)no
study_idstring (uuid)no
kind"extract" | "workspace"no
variablesarray of "age_band" | "sex" | "region" | "conditions"no
justificationstringno
state"submitted" | "approved" | "rejected" | "withdrawn"no
approvalsintegerno
approvals_requiredintegerno

Extract

NameTypeRequiredDescription
idstring (uuid)no
k_requiredintegerno
k_achievedintegerno
generalisationExtract.generalisationno
rows_totalintegerno
rows_releasedintegerno
rows_suppressedintegerno
sha256stringno

Trial

NameTypeRequiredDescription
idstring (uuid)no
study_idstring (uuid)no
titlestringno
registry_refstring | nullno
criteriaCriteriano
state"draft" | "recruiting" | "closed"no
versionintegerno

ContactRequest

Returned only to the treating clinician named on the request.

NameTypeRequiredDescription
idstring (uuid)no
state"awaiting_clinician" | "contacted" | "patient_interested" | "patient_declined" | "not_appropriate" | "consent_withdrawn"no
patient_idstring (uuid)no
trial_titlestringno
criteriaCriteriano
versionintegerno

FraudRule

NameTypeRequiredDescription
rule_type"duplicate_claim" | "impossible_volume" | "outlier_provider"yes
paramsFraudRule.params.option-1 | FraudRule.params.option-2 | FraudRule.params.option-3yes
enabledbooleanyes
expected_versionintegeryes

FraudFlag

NameTypeRequiredDescription
idstring (uuid)no
rule_type"duplicate_claim" | "impossible_volume" | "outlier_provider"no
claim_idstring | null (uuid)no
claim_numberstring | nullno
provider_org_idstring (uuid)no
summarystringno
evidenceobjectno
scorenumberno
state"open" | "under_review" | "cleared" | "referred_for_investigation"no
versionintegerno

Aggregates

NameTypeRequiredDescription
group_too_smallbooleanno
dimension"age_band" | "sex" | "region"no
membersPublishedno
employeesPublishedno
groupsarray of Cellno
conditionsarray of Cellno
cellsarray of Cellno
min_cellintegerno
min_groupintegerno

put-api-ohn-v1-research-config.request defined inline

NameTypeRequiredDescription
k_anonymityintegeryes
min_cellintegeryes
insurer_min_cellintegeryes
employer_min_groupintegeryes
max_suppression_pctintegeryes
versionintegerno
source"configured" | "default"no
expected_versionintegeryes

post-api-ohn-v1-research-studies.request defined inline

NameTypeRequiredDescription
titlestringyes
summarystringyes
ethicspost-api-ohn-v1-research-studies.request.ethicsyes

post-api-ohn-v1-research-studies.request.ethics defined inline

NameTypeRequiredDescription
committeestringyes
referencestringyes
approved_onstring (date)yes
expires_onstring (date)yes
evidence_refstringyes
evidence_sha256stringyes

post-api-ohn-v1-research-studies-id-state.request defined inline

NameTypeRequiredDescription
state"registered" | "suspended" | "closed"yes
reasonstringyes
expected_versionintegeryes

post-api-ohn-v1-research-studies-id-access-requests.request defined inline

NameTypeRequiredDescription
kind"extract" | "workspace"yes
variablesarray of "age_band" | "sex" | "region" | "conditions"yes
justificationstringyes

get-api-ohn-v1-research-access-requests.response-200 defined inline

NameTypeRequiredDescription
itemsarray of AccessRequestno

post-api-ohn-v1-research-access-requests-id-decisions.request defined inline

NameTypeRequiredDescription
decision"approve" | "reject"yes
reasonstringyes

post-api-ohn-v1-research-studies-id-extracts.request defined inline

NameTypeRequiredDescription
request_idstring (uuid)yes
criteriaCriteriano

post-api-ohn-v1-research-studies-id-extracts.response-201 defined inline

NameTypeRequiredDescription
extractExtractno
receiptReceiptno

post-api-ohn-v1-research-studies-id-workspace-queries.request defined inline

NameTypeRequiredDescription
request_idstring (uuid)yes
criteriaCriteriano
dimensionsarray of "age_band" | "sex" | "region" | "condition"no

post-api-ohn-v1-research-studies-id-workspace-queries.response-200 defined inline

NameTypeRequiredDescription
totalPublishedno
cellsarray of Cellno
min_cellintegerno

post-api-ohn-v1-research-cohort-counts.request defined inline

NameTypeRequiredDescription
criteriaCriteriano

post-api-ohn-v1-research-trials.request defined inline

NameTypeRequiredDescription
study_idstring (uuid)yes
titlestringyes
registry_refstringno
criteriaCriteriayes

post-api-ohn-v1-research-trials-id-state.request defined inline

NameTypeRequiredDescription
state"recruiting" | "closed"yes
expected_versionintegeryes

get-api-ohn-v1-research-trials-id-eligibility.response-200 defined inline

NameTypeRequiredDescription
eligiblePublishedno
with_treating_clinicianPublishedno

post-api-ohn-v1-research-trials-id-contact-requests.response-200 defined inline

NameTypeRequiredDescription
routed_to_cliniciansPublishedno
without_research_contact_consentPublishedno
remainingPublishedno

get-api-ohn-v1-research-contact-requests.response-200 defined inline

NameTypeRequiredDescription
itemsarray of ContactRequestno

post-api-ohn-v1-research-contact-requests-id-outcome.request defined inline

NameTypeRequiredDescription
outcome"contacted" | "patient_interested" | "patient_declined" | "not_appropriate"yes
notestringno
expected_versionintegeryes

get-api-ohn-v1-research-fraud-flags.response-200 defined inline

NameTypeRequiredDescription
itemsarray of FraudFlagno
notestringno

post-api-ohn-v1-research-fraud-flags-id-transition.request defined inline

NameTypeRequiredDescription
to"under_review" | "cleared" | "referred_for_investigation"yes
notestringyes
expected_versionintegeryes

post-api-ohn-v1-research-mart-subjects.request defined inline

NameTypeRequiredDescription
sourcestringyes
synthetictrueyes
recordsarray of SubjectRecordyes

post-api-ohn-v1-research-admin-synthetic-load.request defined inline

NameTypeRequiredDescription
countintegeryes
seedintegeryes
treatingarray of post-api-ohn-v1-research-admin-synthetic-load.request.treating.itemyes
employer_org_idsarray of string (uuid)no
insurer_org_idsarray of string (uuid)no

post-api-ohn-v1-research-admin-synthetic-load.request.treating.item defined inline

NameTypeRequiredDescription
clinician_idstring (uuid)yes
org_idstring (uuid)yes

Extract.generalisation defined inline

NameTypeRequiredDescription
levelintegerno
age_band_widthintegerno
region"exact" | "suppressed"no
sex"exact" | "suppressed"no

FraudRule.params.option-1 defined inline

NameTypeRequiredDescription
window_daysintegeryes

FraudRule.params.option-2 defined inline

NameTypeRequiredDescription
max_units_per_provider_dayintegeryes
service_codesarray of stringno

FraudRule.params.option-3 defined inline

NameTypeRequiredDescription
z_thresholdnumberyes
min_providersintegeryes
min_claims_per_providerintegeryes