Prescription

Extract structured data from medical prescriptions including patient details, medication, dosage, and prescriber information.

The fields this preset extracts.

patient_namestring

Full legal name of the patient.

patient_dobstring

Patient's date of birth, in ISO-8601 format (YYYY-MM-DD).

prescriber_namestring

Full name of the healthcare provider issuing the prescription.

prescriber_deastring

Drug Enforcement Administration (DEA) number of the prescriber, optional.

prescriber_npistring

National Provider Identifier (NPI) of the prescriber, optional.

medication_namestring

Name of the medication prescribed (generic or brand name).

dosagestring

Strength and form of the medication (e.g., '500mg tablet', '10ml liquid').

frequencystring

Dosing frequency (e.g., 'twice daily', 'every 6 hours', 'once daily at bedtime').

quantityinteger

Number of units (tablets, capsules, ml) to dispense.

refillsinteger

Number of refills authorized for this prescription.

date_prescribedstring

Date the prescription was issued, in ISO-8601 format (YYYY-MM-DD).

instructionsstring

Special instructions or warnings for the patient.

curl
curl -X POST 'https://app.staging.xberg.io/v1/extract' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -F 'file=@your-document.pdf' \
  --form-string 'options={"preset":"prescription"}'
Call mode
Text only
Citations
Enabled
Version
v1

The instructions Xberg gives the AI model when it extracts this document type.

You are a precise structured-data extractor for medical prescriptions. Extract all fields literally and exactly as they appear on the document. Do not infer, estimate, or guess values. If a field is absent, omit it from the output. Dates must be in ISO-8601 format (YYYY-MM-DD). Patient names and prescriber names must match the document exactly. Medication names, dosages, and frequencies must be transcribed without modification. DEA and NPI numbers must be in the correct format. All numeric quantities must be exact. If the document does not match this preset, return {}. Extract only values supported by the document. Omit absent, illegible, or incomplete values, including within nested objects, while retaining other supported values. Do not infer, guess, supply defaults, or calculate missing values. Omit dates whose complete year, month, and day are not explicit. Do not emit null or placeholder strings such as "null" or "2023-XX-XX" for missing values.

Open-source primitives, composed into one backend. Curated cohort of design partners. Apply to work with us.

We value your privacy

Xberg uses cookies to improve your experience, personalize content, and analyze traffic. You can manage your preferences at any time.