Skip to content

Drug Safety

Drug Safety

DELPHOS performs drug interaction analysis on prescription items using a three-tier cascading lookup. Results are attached to the prescription and must be reviewed — and critical interactions acknowledged — before a prescription can be signed.

Safety Check Endpoint

Run an on-demand interaction analysis on all items in a prescription. This operation is idempotent: any previously stored interactions are cleared and replaced with fresh results on each call.

POST /v1/prescriptions/{prescription_id}/safety-check

The prescription must not be in a terminal status (dispensed or cancelled).

Status codes

CodeMeaning
200Analysis complete — response contains interactions and summary
404Prescription not found
409Prescription is in a terminal status (dispensed or cancelled)
500Interaction service error
Terminal window
curl -X POST "https://your-instance.delphos.app/v1/prescriptions/PRESCRIPTION_ID/safety-check" \
-H "x-api-key: YOUR_API_KEY"

Response shape

{
"prescription_id": "a7b8c9d0-e1f2-3456-ab01-567890123456",
"interactions": [
{
"id": "b1c2d3e4-f5a6-7890-bcde-f12345678901",
"drug_a": "VARFARINA SODICA",
"drug_b": "ASPIRINA",
"severity": "critical",
"interaction_type": "pharmacodynamic",
"description": "Increased bleeding risk due to combined anticoagulant effects",
"recommendation": "Avoid concomitant use; consider alternative analgesic",
"source": "tier1_matrix"
}
],
"safety_summary": {
"passed": false,
"critical_count": 1,
"contraindicated_count": 0,
"major_count": 0,
"moderate_count": 0,
"minor_count": 0
},
"items_checked": 3,
"ingredients_analyzed": ["VARFARINA SODICA", "ASPIRINA", "LOSARTANA POTASSICA"]
}

Response fields

InteractionResponse fields:

FieldTypeDescription
idUUID or nullUUID of the stored interaction record (null for unsaved results)
drug_astringFirst drug name in the interacting pair
drug_bstringSecond drug name in the interacting pair
severitystringSeverity level (see table below)
interaction_typestringPharmacological type, e.g. "pharmacodynamic"
descriptionstringHuman-readable description of the interaction
recommendationstringPrescriber guidance for managing the interaction
sourcestringWhich detection tier found this, e.g. "tier1_matrix"

Severity levels:

SeverityBlocks signingDescription
criticalYesPotentially life-threatening combination
contraindicatedYesCombination should never be used
majorNoSignificant risk; may require dose adjustment
moderateNoModerate risk; monitor closely
minorNoLow risk; usually manageable

Acknowledging Interactions

Before a prescription can be transitioned to signed, all critical and contraindicated interactions must be explicitly acknowledged by the prescribing physician.

Acknowledge a single interaction

PATCH /v1/prescriptions/{prescription_id}/interactions/{interaction_id}/acknowledge

Request body:

FieldTypeRequiredDescription
doctor_idUUIDYesUUID of the doctor acknowledging the interaction
Terminal window
curl -X PATCH "https://your-instance.delphos.app/v1/prescriptions/PRESCRIPTION_ID/interactions/INTERACTION_ID/acknowledge" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"doctor_id": "e5f6a7b8-c9d0-1234-efab-345678901234"}'

Returns 200 with the updated interaction record. Returns 404 if the prescription or interaction is not found, or if the interaction has already been acknowledged.

Acknowledge all interactions at once

POST /v1/prescriptions/{prescription_id}/interactions/acknowledge-all

Request body:

FieldTypeRequiredDescription
doctor_idUUIDYesUUID of the doctor acknowledging all interactions
Terminal window
curl -X POST "https://your-instance.delphos.app/v1/prescriptions/PRESCRIPTION_ID/interactions/acknowledge-all" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"doctor_id": "e5f6a7b8-c9d0-1234-efab-345678901234"}'

Returns 200 with { "acknowledged_count": N }. Returns 404 if the prescription is not found.


Checking Signing Readiness

After the safety check and acknowledgments, verify the prescription is ready to sign by fetching its detail:

GET /v1/prescriptions/{prescription_id}

The response includes:

FieldDescription
can_signtrue when no blocking interactions remain unacknowledged
blocking_interactions_countCount of unacknowledged critical/contraindicated interactions
pending_acknowledgements_countCount of all unacknowledged interactions (any severity)

When can_sign is true, the prescription can be transitioned to signed (see Creating Prescriptions).