Skip to main content

Supervising Prescribers

Some prescribing workflows require a clinician—such as a nurse practitioner or physician assistant—to prescribe on behalf of a supervising clinician. After both clinicians are enrolled in DoseSpot, you can configure that relationship without enrolling either clinician again.

For example, when a newly enrolled nurse practitioner needs to prescribe under a medical director, assign the nurse practitioner as the supervisee and the medical director as the supervisor. If the medical director changes, remove the existing relationship and assign the replacement.

When to use this operation

Use this operation when you need to:

  • Complete setup for a newly enrolled clinician who requires supervision
  • Change a clinician's supervising prescriber
  • Remove a relationship that is no longer valid

You do not need this workflow for independent Prescribing Clinicians or Proxy Clinicians.

DoseSpot represents the supervisee as a Prescribing Agent Clinician (role 5) and the supervisor as a Prescribing Clinician (role 1). The relationship tells DoseSpot which supervising clinician the prescribing agent acts on behalf of for the configured clinic.

Use this endpoint to add or remove the relationship:

POST /fhir/R4/Practitioner/$dosespot-set-supervising-prescriber

The request identifies the supervisee and supervisor by their Medplum Practitioner IDs and optionally specifies whether to add or remove the relationship.

Prerequisites

Before calling the operation:

  1. Restrict access to a trusted administrative caller with permission to invoke this operation.
  2. Configure the DOSESPOT_USER_ID project secret with the DoseSpot clinician ID of a Proxy user with the Clinic Admin role (ClinicianAdmin, role 4). The operation authenticates to DoseSpot with this administrative identity, not the Medplum caller's identity. The Medplum caller does not need to be enrolled in DoseSpot or have a DoseSpot clinician role.
  3. Enroll both Practitioners in DoseSpot. Each must have a DoseSpot clinician ID on their ProjectMembership.
  4. Verify that the supervisor is a Prescribing Clinician (role 1) and the supervisee is a Prescribing Agent Clinician (role 5). The operation does not independently validate role eligibility.

Workflow

  1. Enroll the supervisor as a Prescribing Clinician (role 1).
  2. Enroll the supervisee as a Prescribing Agent Clinician (role 5).
  3. Call the operation to attach the supervisor for DOSESPOT_CLINIC_ID.
  4. To clear the relationship for that clinic, call the operation again with action: "remove".

The relationship is stored in DoseSpot. The operation does not create or update a FHIR resource representing the relationship in Medplum.

Operation Input Parameters

ParameterRequiredTypeDescription
practitionerIdYesidThe Medplum Practitioner ID of the supervisee (the Prescribing Agent)
supervisorPractitionerIdYesidThe Medplum Practitioner ID of the supervisor. Required on both add and remove; the operation resolves this clinician even when removing
actionNo"add" | "remove""add" sets the supervisor (default). "remove" clears the supervisor relationship for the configured clinic

Send these fields as a plain JSON object. Pass the bare IDs from the two Medplum Practitioner resources, without a Practitioner/ prefix. This operation does not accept a Patient ID. The response uses a FHIR Parameters resource, as described in Operation Response.

Add a Supervisor

Medplum CLI

The Medplum CLI supplies the FHIR base URL and authentication from the selected profile:

medplum post -p <profile> 'Practitioner/$dosespot-set-supervising-prescriber' '{
"practitionerId": "supervisee-practitioner-id",
"supervisorPractitionerId": "supervisor-practitioner-id"
}'

TypeScript

import type { Parameters } from '@medplum/fhirtypes';

const result = await medplum.post<Parameters>(
medplum.fhirUrl('Practitioner', '$dosespot-set-supervising-prescriber'),
{
practitionerId: 'supervisee-practitioner-id',
supervisorPractitionerId: 'supervisor-practitioner-id',
}
);

// The response is a FHIR Parameters resource.
console.log(result.parameter);

cURL

curl 'https://api.medplum.com/fhir/R4/Practitioner/$dosespot-set-supervising-prescriber' \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MY_ACCESS_TOKEN" \
-d '{
"practitionerId": "supervisee-practitioner-id",
"supervisorPractitionerId": "supervisor-practitioner-id"
}'

Remove a Supervisor

Medplum CLI

medplum post -p <profile> 'Practitioner/$dosespot-set-supervising-prescriber' '{
"practitionerId": "supervisee-practitioner-id",
"supervisorPractitionerId": "supervisor-practitioner-id",
"action": "remove"
}'

TypeScript

import type { Parameters } from '@medplum/fhirtypes';

const result = await medplum.post<Parameters>(
medplum.fhirUrl('Practitioner', '$dosespot-set-supervising-prescriber'),
{
practitionerId: 'supervisee-practitioner-id',
supervisorPractitionerId: 'supervisor-practitioner-id',
action: 'remove',
}
);

cURL

curl 'https://api.medplum.com/fhir/R4/Practitioner/$dosespot-set-supervising-prescriber' \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MY_ACCESS_TOKEN" \
-d '{
"practitionerId": "supervisee-practitioner-id",
"supervisorPractitionerId": "supervisor-practitioner-id",
"action": "remove"
}'
Remove is clinic-scoped

DoseSpot clears whichever supervisor currently exists for DOSESPOT_CLINIC_ID. supervisorPractitionerId is still required and must resolve to an enrolled clinician, but DoseSpot does not verify that identity when clearing the relationship.

Operation Response

The operation returns a FHIR Parameters resource. Each field below appears as a named entry in Parameters.parameter; primitive values use the corresponding FHIR value[x] property. The nested result parameter contains the raw DoseSpot result as part entries.

FieldTypeDescription
practitionerIdvalueIdThe supervisee Practitioner ID
supervisorPractitionerIdvalueIdThe supplied supervisor Practitioner ID
clinicianIdvalueIntegerThe supervisee's DoseSpot clinician ID
supervisorClinicianIdvalueIntegerThe supplied supervisor's DoseSpot clinician ID
clinicIdvalueIntegerThe DoseSpot clinic the relationship was set or cleared on
actionvalueCodeThe action that was performed: "add" or "remove"
resultpartThe raw DoseSpot ResultCode and ResultDescription

On remove, the supervisor parameters identify the supervisor supplied to the operation. They do not confirm which supervisor relationship DoseSpot cleared.

Troubleshooting

ErrorCauseResolution
Missing practitionerId / supervisorPractitionerIdRequired input omittedPass both Practitioner IDs
practitionerId and supervisorPractitionerId must refer to different PractitionersSame ID on both sidesUse two distinct Practitioners
Invalid actionaction is not "add" or "remove"Omit action (defaults to "add") or pass one of those two values
No DoseSpot clinician IDOne or both Practitioners are not enrolledEnroll both Practitioners before setting a supervising prescriber
No ProjectMembership foundSupervisee or supervisor has no membershipCreate a ProjectMembership for that Practitioner, then enroll
Missing DOSESPOT_USER_ID or DoseSpot authorization errorThe administrative DoseSpot identity is missing or lacks the required permissionsSet DOSESPOT_USER_ID to the clinician ID of a Proxy user with the Clinic Admin role (ClinicianAdmin, role 4)
Invalid DOSESPOT_CLINIC_IDClinic secret is not a numberSet DOSESPOT_CLINIC_ID to the numeric DoseSpot clinic ID
Failed to add/remove supervising prescriberDoseSpot returned a non-OK ResultCodeUse ResultDescription from the error to correct the clinic or clinician data