Aller au contenu

← Tous les contrats

OHN-59 Medication Safety Knowledge

Version
1.1.0
OpenAPI
3.1.0
Source dans le dépôt
modules/OHN-59/api/openapi.json
Serveurs
https://opeshealthnetwork.com/api/ohn/v1/medication-safety
Authentification
bearer: http bearer

Télécharger le contrat (JSON)

Les contrats sont rédigés en anglais.

Server paths are under /api/ohn/v1/medication-safety. Reconciled to the observed TypeScript behaviour (docs/program/java/ohn-59-contract-changes.md). Default deny: role AND purpose of use must match. Request bodies are strict (unknown fields are 422); the service validates them and answers 422 domain_validation_failed with details.

Opérations

OHN-59

GET/knowledge/activeActive knowledge version of the jurisdiction (configured:false when none)

Identifiant d’opération: getActiveKnowledge

Authentification: bearer

Réponses

CodeDescriptionType de média
200Success
application/json: Result
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—
GET/knowledge/versionsKnowledge versions, newest first

Identifiant d’opération: listVersions

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
statequery"draft" | "in_review" | "active" | "retired"non

Réponses

CodeDescriptionType de média
200Success
application/json: Result
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—
POST/knowledge/versionsCreate a draft knowledge version from a document (F001)

Identifiant d’opération: createVersion

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
Idempotency-Keyheaderstringoui

Corps de la requête

Strict JSON object, documented by components.schemas.CreateVersionCommand; validated by the service (unknown fields are 422).

  • application/json: object

Réponses

CodeDescriptionType de média
201Success
application/json: Result
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—
POST/knowledge/versions/load-demoLoad the labelled synthetic demo set as a draft (non-production only, OHN59_ALLOW_DEMO_KNOWLEDGE)

Identifiant d’opération: loadDemoKnowledge

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
Idempotency-Keyheaderstringoui

Corps de la requête

Strict JSON object, documented by components.schemas.EmptyCommand; validated by the service (unknown fields are 422).

  • application/json: object

Réponses

CodeDescriptionType de média
201Success
application/json: Result
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—
GET/knowledge/versions/{id}One version with settings and next actions

Identifiant d’opération: getVersion

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
idpathstring (uuid)oui

Réponses

CodeDescriptionType de média
200Success
application/json: Result
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—
GET/knowledge/versions/{id}/entriesBrowse and search a section of a version

Identifiant d’opération: listEntries

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
idpathstring (uuid)oui
sectionquery"medications" | "classes" | "memberships" | "allergy_cross_reactivity" | "interactions" | "dose_ranges" | "pregnancy" | "duplicate_groups" | "lab_contraindications"oui
qquerystringnon
offsetqueryintegernon
limitqueryintegernon

Réponses

CodeDescriptionType de média
200Success
application/json: Result
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—
GET/knowledge/versions/{id}/diffDifference to the previous (or a chosen) version

Identifiant d’opération: diffVersion

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
idpathstring (uuid)oui
againstquerystring (uuid)non

Réponses

CodeDescriptionType de média
200Success
application/json: Result
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—
GET/knowledge/versions/{id}/historyState change history of a version

Identifiant d’opération: versionHistory

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
idpathstring (uuid)oui

Réponses

CodeDescriptionType de média
200Success
application/json: Result
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—
POST/knowledge/versions/{id}/submitSubmit a draft for review (needs a clean validation report)

Identifiant d’opération: submitVersion

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
idpathstring (uuid)oui
Idempotency-Keyheaderstringoui

Corps de la requête

Strict JSON object, documented by components.schemas.SubmitCommand; validated by the service (unknown fields are 422).

  • application/json: object

Réponses

CodeDescriptionType de média
200Success
application/json: Result
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—
POST/knowledge/versions/{id}/approveSecond-person approval and activation

Identifiant d’opération: approveVersion

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
idpathstring (uuid)oui
Idempotency-Keyheaderstringoui

Corps de la requête

Strict JSON object, documented by components.schemas.ApproveCommand; validated by the service (unknown fields are 422).

  • application/json: object

Réponses

CodeDescriptionType de média
200Success
application/json: Result
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—
POST/knowledge/versions/{id}/rejectSend an in-review version back to draft

Identifiant d’opération: rejectVersion

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
idpathstring (uuid)oui
Idempotency-Keyheaderstringoui

Corps de la requête

Strict JSON object, documented by components.schemas.ReasonCommand; validated by the service (unknown fields are 422).

  • application/json: object

Réponses

CodeDescriptionType de média
200Success
application/json: Result
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—
POST/knowledge/versions/{id}/retireRetire the active version

Identifiant d’opération: retireVersion

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
idpathstring (uuid)oui
Idempotency-Keyheaderstringoui

Corps de la requête

Strict JSON object, documented by components.schemas.ReasonCommand; validated by the service (unknown fields are 422).

  • application/json: object

Réponses

CodeDescriptionType de média
200Success
application/json: Result
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—
GET/knowledge/importersImport formats and the CSV column contract

Identifiant d’opération: listImporters

Authentification: bearer

Réponses

CodeDescriptionType de média
200Success
application/json: Result
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—
GET/knowledge/importsImports of the jurisdiction (latest 100)

Identifiant d’opération: listImports

Authentification: bearer

Réponses

CodeDescriptionType de média
200Success
application/json: Result
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—
POST/knowledge/importsImport a licensed knowledge export as a draft version

Identifiant d’opération: runImport

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
Idempotency-Keyheaderstringoui

Corps de la requête

Strict JSON object, documented by components.schemas.ImportCommand; validated by the service (unknown fields are 422).

  • application/json: object

Réponses

CodeDescriptionType de média
201Success
application/json: Result
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—
GET/knowledge/imports/{id}One import with its validation report

Identifiant d’opération: getImport

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
idpathstring (uuid)oui

Réponses

CodeDescriptionType de média
200Success
application/json: Result
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—
POST/checks/evaluateMedication safety check for a patient (live)

Identifiant d’opération: evaluateCheck

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
Idempotency-Keyheaderstringoui

Corps de la requête

Strict JSON object, documented by components.schemas.EvaluateCommand; validated by the service (unknown fields are 422).

  • application/json: object

Réponses

CodeDescriptionType de média
200Success
application/json: Result
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—
POST/checks/simulateCheck with typed hypothetical facts on any version (no patient read)

Identifiant d’opération: simulateCheck

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
Idempotency-Keyheaderstringoui

Corps de la requête

Strict JSON object, documented by components.schemas.SimulateCommand; validated by the service (unknown fields are 422).

  • application/json: object

Réponses

CodeDescriptionType de média
200Success
application/json: Result
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—
GET/checks/evaluationsStored evaluations of the jurisdiction

Identifiant d’opération: listEvaluations

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
modequery"live" | "simulation"non
limitqueryintegernon

Réponses

CodeDescriptionType de média
200Success
application/json: Result
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—
GET/checks/evaluations/{id}One stored evaluation and its outcome

Identifiant d’opération: getEvaluation

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
idpathstring (uuid)oui

Réponses

CodeDescriptionType de média
200Success
application/json: Result
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—
POST/checks/evaluations/{id}/outcomeRecord what the prescriber did with a live evaluation (once)

Identifiant d’opération: recordOutcome

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
idpathstring (uuid)oui
Idempotency-Keyheaderstringoui

Corps de la requête

Strict JSON object, documented by components.schemas.OutcomeCommand; validated by the service (unknown fields are 422).

  • application/json: object

Réponses

CodeDescriptionType de média
201Success
application/json: Result
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—
GET/reportsReport catalog

Identifiant d’opération: listReports

Authentification: bearer

Réponses

CodeDescriptionType de média
200Success
application/json: Result
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—
GET/reports/{reportId}Run a report (R001 coverage, R002 warnings, R003 change ledger)

Identifiant d’opération: runReport

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
reportIdpath"OHN-59-R001" | "OHN-59-R002" | "OHN-59-R003"oui
version_idquerystring (uuid)non
fromquerystringnon
toquerystringnon

Réponses

CodeDescriptionType de média
200Success
application/json: Result
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—
GET/reports/{reportId}/exportSigned CSV export (HMAC-SHA256 in X-OHN59-Signature)

Identifiant d’opération: exportReport

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
reportIdpath"OHN-59-R001" | "OHN-59-R002" | "OHN-59-R003"oui
version_idquerystring (uuid)non
fromquerystringnon
toquerystringnon

Réponses

CodeDescriptionType de média
200Success
text/csv: string
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—
GET/auditLatest 200 audit records of the jurisdiction

Identifiant d’opération: listAudit

Authentification: bearer

Réponses

CodeDescriptionType de média
200Success
application/json: Result
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—
POST/admin/outbox/relayReport the pending outbox (delivery is done by the platform relay)

Identifiant d’opération: relayOutbox

Authentification: bearer

Paramètres

NomEmplacementTypeObligatoireDescription
Idempotency-Keyheaderstringoui

Corps de la requête

Strict JSON object, documented by components.schemas.EmptyCommand; validated by the service (unknown fields are 422).

  • application/json: object

Réponses

CodeDescriptionType de média
200Success
application/json: Result
400Malformed request or missing Idempotency-Key—
401Unauthenticated—
403Denied by policy (role, purpose, second person, test checks disabled)—
404Not found in the caller's jurisdiction—
409Version conflict, invalid transition, validation failed or idempotency mismatch—
413Payload too large—
422Domain validation failed
application/json: Error
429Rate limited—
503Not configured or dependency unavailable (fail closed)—

Schémas

Result

object

Error

NomTypeObligatoireDescription
errorstringoui
messagestringnon
detailsobjectnon

EmptyCommand

object

CreateVersionCommand

NomTypeObligatoireDescription
documentKnowledgeDocumentouiSections are arrays of strict objects, validated by the service (see docs/program/java/ohn-59-analysis.md and modules/OHN-59/docs/import-contract.md). source.kind synthetic_demo is refused here.

KnowledgeDocument

Sections are arrays of strict objects, validated by the service (see docs/program/java/ohn-59-analysis.md and modules/OHN-59/docs/import-contract.md). source.kind synthetic_demo is refused here.

NomTypeObligatoireDescription
labelstringoui
noticestringoui
sourceobjectoui
settingsobjectoui
medicationsarray of objectoui
classesarray of objectoui
membershipsarray of objectoui
allergy_cross_reactivityarray of objectoui
interactionsarray of objectoui
dose_rangesarray of objectoui
pregnancyarray of objectoui
duplicate_groupsarray of objectoui
lab_contraindicationsarray of objectoui

SubmitCommand

NomTypeObligatoireDescription
expected_row_versionintegeroui
notestringnon

ApproveCommand

NomTypeObligatoireDescription
expected_row_versionintegeroui
approval_refstringoui
notestringnon

ReasonCommand

NomTypeObligatoireDescription
expected_row_versionintegeroui
reasonstringoui

ImportCommand

NomTypeObligatoireDescription
format"ohn59.csv.v1" | "ohn59.json.v1"oui
labelstringoui
noticestringnon
sourceImportCommand.sourceoui
settingsobjectnon
filesobjectnonohn59.csv.v1: one CSV text per section
documentanynonohn59.json.v1: knowledge sections

EvaluateCommand

NomTypeObligatoireDescription
patient_idstring (uuid)oui
proposedarray of objectoui
contextobjectnon
checksarray of "knowledge_coverage" | "allergy" | "interaction" | "dose" | "pregnancy" | "breastfeeding" | "duplicate_therapy" | "lab_contraindication"non
callerobjectnon
acting_forEvaluateCommand.acting_fornon

SimulateCommand

NomTypeObligatoireDescription
version_idstring (uuid)oui
factsobjectoui
proposedarray of objectoui
checksarray of stringnon

OutcomeCommand

NomTypeObligatoireDescription
action"signed" | "abandoned" | "changed"oui
overridesarray of OutcomeCommand.overrides.itemnon

ImportCommand.source défini sur place

NomTypeObligatoireDescription
namestringoui
versionstringoui
licence_refstringoui

EvaluateCommand.acting_for défini sur place

NomTypeObligatoireDescription
principal_idstring (uuid)oui
organization_idstring (uuid)oui

OutcomeCommand.overrides.item défini sur place

NomTypeObligatoireDescription
warning_idstringoui
reasonstringoui