← Tous les contrats
OHN-15 Consent Management and Ledger
- Version
- 1.0.0
- OpenAPI
- 3.1.0
- Source dans le dépôt
modules/OHN-15/api/openapi.json- Serveurs
https://opeshealthnetwork.com/api/ohn/v1
- Authentification
bearer: http bearer
Télécharger le contrat (JSON)
Les contrats sont rédigés en anglais.
Consent grant, revoke, renew, enforcement decision, reports. Default deny. Authentication: bearer token (OHN gateway token (ES256, audience ohn-15, claims role, jurisdiction, organization_id, purpose)). All POSTs require an Idempotency-Key header (8-128 characters).
Opérations
OHN-15
POST/consentsRequest a consent (W001 start)
Identifiant d’opération: requestConsent
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
Idempotency-Key | header | string | oui | |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
201 | Created | application/json: object
|
400 | Typed error | |
401 | Typed error | |
403 | Typed error | |
404 | Typed error | |
409 | Typed error | |
422 | Typed error | |
429 | Typed error | |
503 | Typed error | |
GET/patients/{id}/consentsList a patient's consents
Identifiant d’opération: listPatientConsents
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
id | path | string (uuid) | oui | |
status | query | string | non | |
cursor | query | string | non | |
Réponses
| Code | Description | Type de média |
|---|
200 | Page of consents | application/json: object
|
401 | Typed error | |
403 | Typed error | |
404 | Typed error | |
GET/patients/{id}/consent-access-logRecipient access history (P007)
Identifiant d’opération: patientAccessLog
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
id | path | string (uuid) | oui | |
cursor | query | string | non | |
Réponses
| Code | Description | Type de média |
|---|
200 | Decisions recorded for the patient | application/json: object
|
403 | Typed error | |
404 | Typed error | |
GET/consents/worklistConsents awaiting action (steward)
Identifiant d’opération: consentWorklist
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | OK | application/json: object
|
403 | Typed error | |
GET/consents/{id}Consent detail with workflow history
Identifiant d’opération: consentDetail
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
id | path | string (uuid) | oui | |
Réponses
| Code | Description | Type de média |
|---|
200 | OK | application/json: object
|
404 | Typed error | |
POST/consents/{id}/transitionsAdvance W001 (informed_choice, granted, denied)
Identifiant d’opération: transitionConsent
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
id | path | string (uuid) | oui | |
Idempotency-Key | header | string | oui | |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
200 | OK | application/json: object
|
409 | Typed error | |
422 | Typed error | |
POST/consents/{id}/revokeRevoke (W002)
Identifiant d’opération: revokeConsent
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
id | path | string (uuid) | oui | |
Idempotency-Key | header | string | oui | |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
200 | Revoked or scheduled; downstream delivery is reported as pending until the outbox relay confirms it | application/json: object
|
404 | Typed error | |
409 | Typed error | |
422 | Typed error | |
POST/consents/{id}/representative-reviewRepresentative approval (F003, steward only)
Identifiant d’opération: reviewRepresentative
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
id | path | string (uuid) | oui | |
Idempotency-Key | header | string | oui | |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
200 | OK | application/json: object
|
403 | Typed error | |
422 | Typed error | |
503 | Typed error | |
POST/consents/{id}/renewRenewal (F004)
Identifiant d’opération: renewConsent
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
id | path | string (uuid) | oui | |
Idempotency-Key | header | string | oui | |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
200 | OK | application/json: object
|
409 | Typed error | |
422 | Typed error | |
POST/consents/decisionsEnforcement decision (service role only)
Identifiant d’opération: decideAccess
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
Idempotency-Key | header | string | oui | |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
200 | permit or deny; deny always carries error_code | application/json: object
|
403 | Typed error | |
503 | Typed error | |
POST/consents/maintenance/sweepApply expiry and scheduled revocation (W003)
Identifiant d’opération: sweepConsents
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
Idempotency-Key | header | string | oui | |
Réponses
| Code | Description | Type de média |
|---|
200 | Counts of expired, revoked, activated | application/json: object
|
POST/consents/maintenance/drain-outboxRelay pending events; with no bus configured reports pending only
Identifiant d’opération: drainConsentOutbox
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
Idempotency-Key | header | string | oui | |
Réponses
| Code | Description | Type de média |
|---|
200 | delivered / pending counts | application/json: object
|
GET/consent-policyJurisdiction policy versions
Identifiant d’opération: readConsentPolicy
Authentification: bearer
Réponses
| Code | Description | Type de média |
|---|
200 | OK | application/json: object
|
POST/consent-policyDraft a policy version (steward)
Identifiant d’opération: draftConsentPolicy
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
Idempotency-Key | header | string | oui | |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
201 | Draft created | application/json: object
|
422 | Typed error | |
POST/consent-policy/{version}/activateActivate (dual control: not the drafter)
Identifiant d’opération: activateConsentPolicy
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
version | path | integer | oui | |
Idempotency-Key | header | string | oui | |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
200 | Active | application/json: object
|
403 | Typed error | |
409 | Typed error | |
GET/consents/reports/{reportId}Run OHN-15-R001, R002 or R003
Identifiant d’opération: runConsentReport
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
reportId | path | string | oui | |
period_from | query | string | non | |
period_to | query | string | non | |
purpose | query | string | non | |
recipient | query | string | non | |
patient_scope | query | string | non | |
facility | query | string | non | |
reason | query | string | non | |
cursor | query | string | non | |
Réponses
| Code | Description | Type de média |
|---|
200 | Report | application/json: object
|
422 | Typed error | |
POST/consents/reports/{reportId}/exportCreate a signed short-lived export (csv|pdf)
Identifiant d’opération: createConsentExport
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
reportId | path | string | oui | |
Idempotency-Key | header | string | oui | |
Corps de la requête (obligatoire)
Réponses
| Code | Description | Type de média |
|---|
201 | download_path valid for five minutes, owner only | application/json: object
|
GET/consents/exports/{token}Download; 410 when expired or when consent changed after creation
Identifiant d’opération: fetchConsentExport
Authentification: bearer
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|
token | path | string | oui | |
Réponses
| Code | Description | Type de média |
|---|
200 | File | application/json: object
|
404 | Typed error | |
410 | Typed error | |
Schémas
Error
| Nom | Type | Obligatoire | Description |
|---|
error | string | oui | |
message | string | non | |
details | object | non | field -> code; never contains submitted values |
Code
Controlled-vocabulary code from the active jurisdiction policy
string
ConsentGrantCommand
| Nom | Type | Obligatoire | Description |
|---|
patient_id | string (uuid) | oui | |
recipient_org | string (uuid) | oui | |
data_categories | any | oui | Array of codes (1-64, unique); a comma, semicolon or space separated string is also accepted and normalised |
purpose | Code | oui | Controlled-vocabulary code from the active jurisdiction policy |
start_at | string (date-time) | oui | |
expires_at | string (date-time) | oui | |
legal_basis | Code | oui | Controlled-vocabulary code from the active jurisdiction policy |
TransitionCommand
| Nom | Type | Obligatoire | Description |
|---|
expected_version | integer | oui | |
to_state | "informed_choice" | "granted" | "denied" | oui | |
evidence_ref | string (uuid) | non | |
reason | string | oui | |
RevocationCommand
| Nom | Type | Obligatoire | Description |
|---|
consent_id | string (uuid) | oui | |
revocation_scope | "full" | "data_categories" | oui | |
revoked_data_categories | any | non | Array of codes; required exactly when revocation_scope is data_categories; a separated string is also accepted |
reason | string | oui | |
requested_by | string (uuid) | oui | Must equal the authenticated principal |
effective_at | string (date-time) | oui | |
expected_version | integer | oui | |
RepresentativeReviewCommand
| Nom | Type | Obligatoire | Description |
|---|
consent_id | string (uuid) | oui | |
representative_ref | string (uuid) | oui | |
authority_evidence | string (uuid) | oui | |
decision | "approve" | "reject" | oui | |
reason | string | oui | |
expected_version | integer | oui | |
RenewalCommand
| Nom | Type | Obligatoire | Description |
|---|
consent_id | string (uuid) | oui | |
new_expiry | string (date-time) | oui | |
scope_changes | string | non | |
patient_confirmation | string (uuid) | oui | |
expected_version | integer | oui | |
DecisionCommand
| Nom | Type | Obligatoire | Description |
|---|
patient_id | string (uuid) | oui | |
recipient_org | string (uuid) | oui | |
resource_class | Code | oui | Controlled-vocabulary code from the active jurisdiction policy |
purpose | Code | oui | Controlled-vocabulary code from the active jurisdiction policy |
facility_id | string (uuid) | oui | |
channel | "online" | "cache_revalidation" | "async_export" | non | |
cached_decision_epoch | integer | non | |
DecisionResult
| Nom | Type | Obligatoire | Description |
|---|
decision | "permit" | "deny" | oui | |
error_code | null | "no_consent" | "scope_mismatch" | "consent_revoked" | "consent_expired" | "consent_not_yet_effective" | "consent_pending" | "consent_denied" | non | |
consent_id | string | null | non | |
decision_epoch | integer | oui | |
stale_cache_rejected | boolean | non | |
cache | DecisionResult.cache | oui | |
PolicyDraftCommand
| Nom | Type | Obligatoire | Description |
|---|
config | object | oui | See schema PolicyConfig; validated server-side (codes, no duplicates, strict keys). |
reason | string | oui | |
ConsentView
| Nom | Type | Obligatoire | Description |
|---|
id | string (uuid) | oui | |
status | "requested" | "identity_authorized" | "informed_choice" | "granted" | "effective" | "denied" | "revocation_requested" | "revoked" | "expired" | oui | Computed from time, so expiry and revocation apply even before a sweep runs |
stored_status | string | non | |
version | integer | oui | |
patient_id | string | non | |
recipient_org | string | non | |
data_categories | array of string | non | |
purpose | string | non | |
legal_basis | string | non | |
start_at | string | non | |
expires_at | string | non | |
receipt | object | non | |
ConsentPage
| Nom | Type | Obligatoire | Description |
|---|
items | array of ConsentView | non | |
next_cursor | string | null | non | |
epoch | integer | non | |
Report
| Nom | Type | Obligatoire | Description |
|---|
report_id | string | oui | |
columns | array of string | oui | |
rows | array of object | oui | |
summary | object | non | |
next_cursor | string | null | non | |
state | "rendered" | "no_authorized_data" | oui | |
suppression | Report.suppression | non | |
PolicyConfig
| Nom | Type | Obligatoire | Description |
|---|
purposes | array of Code | oui | |
legal_bases | array of PolicyConfig.legal_bases.item | oui | |
data_categories | array of Code | oui | |
max_consent_duration_days | integer | null | oui | null is an explicit jurisdiction decision that no maximum applies |
min_aggregate_cell_size | integer | oui | |
ExportCommand
| Nom | Type | Obligatoire | Description |
|---|
format | "csv" | "pdf" | oui | |
filters | object | non | Same filters as the report (period_from, period_to, purpose, recipient, patient_scope, facility, reason); strict |
ActivateCommand
| Nom | Type | Obligatoire | Description |
|---|
reason | string | oui | |
DecisionResult.cache défini sur place
| Nom | Type | Obligatoire | Description |
|---|
ttl_seconds | integer | non | |
valid_until | string | null | non | |
Report.suppression défini sur place
| Nom | Type | Obligatoire | Description |
|---|
min_cell_size | integer | null | non | |
applied | boolean | non | |
PolicyConfig.legal_bases.item défini sur place
| Nom | Type | Obligatoire | Description |
|---|
code | Code | oui | Controlled-vocabulary code from the active jurisdiction policy |
requires_affirmative_consent | boolean | oui | |