Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.rxscale.com/llms.txt

Use this file to discover all available pages before exploring further.

Prescriptions

Retrieve prescription information including doctor data and status.

Get Prescription Details

GET /v1/management/prescriptions/{prescription_uid}
prescription_uid
string
required
The prescription UID
Required permission: prescription:read

Example Request

curl -X GET "https://api.rxscale.com/v1/management/prescriptions/px-abc123" \
  -H "X-API-Key: your-api-key-here"

Response

{
  "uid": "px-abc123",
  "status": "signed",
  "doctor": {
    "uid": "doc-456",
    "display_name": "Dr. Schmidt"
  },
  "rendered": true
}

Response Fields

FieldTypeDescription
uidstringUnique identifier for the prescription
statusstringCurrent prescription status (e.g. signed, waiting_for_doctor)
doctorobjectThe prescribing doctor
doctor.uidstringDoctor UID
doctor.display_namestringDoctor display name
renderedbooleantrue when a rendered PDF is available for the prescription, false otherwise

Error Responses

Status CodeDescription
403Missing prescription:read permission
404Prescription not found or belongs to another organisation

Externally Signed Prescriptions

Prescriptions whose items were created with _skip_validation (or _rxscale_skip_validation) on the line item — i.e. items without an attached anamnesis — can be signed outside the rxscale platform and then registered for fulfilment via the Management API. The flow consists of two API calls:
  1. POST /v1/management/prescriptions/{prescription_uid}/render – asks rxscale to render the unsigned prescription PDF. The endpoint returns immediately; the PDF is produced asynchronously and becomes available as prescription.file.
  2. POST /v1/management/prescriptions/{prescription_uid}/external-sign – once the PDF is available, mark the prescription as EXTERNALLY_SIGNED, copy the PDF into the signed bucket, and dispatch it to the pharmacy.
Both endpoints require the prescription:external_sign permission.
Only prescriptions where every item lacks an anamnesis_uid can be externally signed. Mixed prescriptions are rejected with 409 Conflict.

Render Prescription PDF

POST /v1/management/prescriptions/{prescription_uid}/render
prescription_uid
string
required
The prescription UID
Required permission: prescription:external_sign Triggers asynchronous rendering of the unsigned prescription PDF. The endpoint publishes a prescription.render event and returns 202 Accepted. Poll GET /v1/management/prescriptions/{prescription_uid} (or wait for a webhook) until file is populated before calling external-sign.

Example Request

curl -X POST "https://api.rxscale.com/v1/management/prescriptions/px-abc123/render" \
  -H "X-API-Key: your-api-key-here"

Response (202 Accepted)

{
  "uid": "px-abc123",
  "message": "Prescription rendering triggered"
}

Error Responses

Status CodeDescription
403Missing prescription:external_sign permission
404Prescription not found or belongs to another organisation

External-Sign Prescription

POST /v1/management/prescriptions/{prescription_uid}/external-sign
prescription_uid
string
required
The prescription UID
Required permission: prescription:external_sign Marks an already-rendered prescription as EXTERNALLY_SIGNED. The endpoint:
  1. Verifies the prescription is in WAITING_FOR_DOCTOR status, all items lack an anamnesis, and the rendered file is present.
  2. Copies the PDF from the unsigned bucket to the signed-prescription bucket.
  3. Updates the prescription status to EXTERNALLY_SIGNED and writes a PrescriptionLog entry attributed to the calling API key.
  4. Publishes a pharmacy_manager.send_prescription event so the prescription is dispatched to the pharmacy.

Example Request

curl -X POST "https://api.rxscale.com/v1/management/prescriptions/px-abc123/external-sign" \
  -H "X-API-Key: your-api-key-here"

Response (200 OK)

{
  "uid": "px-abc123",
  "status": "EXTERNALLY_SIGNED"
}

Error Responses

Status CodeDescription
403Missing prescription:external_sign permission
404Prescription not found or belongs to another organisation
409Prescription is not in WAITING_FOR_DOCTOR status, has at least one item with an anamnesis, or has no rendered PDF yet