Skip to main content

Drug Interaction Check

Beta

The ScriptSure integration is in beta. Features and APIs may change.

Bot: scriptsure-drug-interaction-bot

Checks one or more candidate drugs for drug-drug interactions (DDI) against a patient's current medication list in ScriptSure. Two modes are supported:

  • check (default) — lightweight DDI list
  • details — full FDB screening payload per candidate including allergy, age, and duplicate-therapy checks

If the prescriber has not completed ScriptSure EULA or identity proofing, returns { interactions: [], skipped: true, providerNotReady: true } rather than throwing.

const result = await medplum.executeBot(
{ system: 'https://www.medplum.com/bots', value: 'scriptsure-drug-interaction-bot' },
{
patientId: 'patient-xyz',
candidateRoutedMedIds: [12345, 67890], // ScriptSure ROUTED_MED_ID integers
mode: 'check', // 'check' (default) or 'details'
timeframeDays: 365, // optional, defaults to 365
}
);

Input fields

FieldTypeDescription
patientIdstringMedplum Patient resource ID
candidateRoutedMedIdsnumber[]ScriptSure ROUTED_MED_ID integers for the drugs to check
mode'check' | 'details'Interaction check mode. Defaults to 'check'
timeframeDaysnumberLookback window for current medications. Defaults to 365

Response fields

All modes return the same top-level shape:

FieldTypeDescription
interactionsDrugInteraction[]DDI results. Empty array in details mode and when the provider is not ready.
skippedbooleantrue when the check was skipped because the provider has not completed EULA or identity proofing.
providerNotReadybooleantrue alongside skipped when the provider is not yet enrolled.
detailsRecord<string, unknown>[]details mode only. One full FDB drugcheck response object per successfully resolved candidate. Shape varies by FDB version.
detailsErrors{ routedMedId: number; message: string }[]details mode only. Per-candidate resolution failures. Sibling candidates are still processed.

Each interactions item (check mode):

FieldTypeDescription
ROUTED_MED_IDnumberThe candidate drug that has an interaction
DDI_DESstringInteraction description (e.g. "LOOP DIURETICS/DESMOPRESSIN")
DDI_SLstringSeverity level code (FDB-defined; treat as opaque string)