Photon: check the state rule before you place the order

For a team that prescribes through Photon Health and places orders from its own code. One call to Provkeep between writing the prescription and placing the order, and the answer shown to your clinician or pharmacist.

Provkeep is not a Photon partner and holds no Photon credential. Nothing about the patient is sent to Provkeep.

Why this moment

Prescriptions written with Photon are not assigned or sent to a specific pharmacy until an Order is placed. This action can be completed programmatically.

Photon's documentation, Place orders, read 19 November 2026. The order you are about to place already names the product and the state it ships to, which is all a Provkeep check needs.

The recipe

import { Provkeep, chartNote } from "./provkeep.mjs";   // the Node file from the code kit
const pk = new Provkeep(process.env.PROVKEEP_KEY);

// 1. Just before your own createOrder call. Order facts only: the product and
//    the two letter state it ships to. Never the patient's name, birth date or
//    address, and never Photon's patient ID. code is your own order reference.
const answer = await pk.check({
  code: myOrderRef,
  event: "prescription_signed",
  patient_state: shipTo.state,          // the same state you send Photon
  consult_type: "video",                // in_person | video | phone | async_questionnaire
  purpose: "treatment",                 // a code, never words about the patient
  lines: [{ peptide: "BPC-157", dosage_form: "injectable" }],
}, { idempotencyKey: myOrderRef });

// 2. Show the answer, with its quotes, sources and dates, to whoever decides.
await showForReview(myOrderRef, chartNote(answer));      // yours

// 3. Place the Photon order exactly as you do today.
await placePhotonOrder();                                // yours: Photon's createOrder

The Node, PHP and Python files are in the code kit. For the order call, use Photon's own documentation.

If you hold an order for review

With Hold orders marked Restricted turned on in Provkeep, pass your own pause step. It runs only when a rule on this order reads Restricted. If Provkeep is slow or unreachable, the kit answers checked: false, nothing is held, and your order goes ahead.

const answer = await pk.check(order, {
  idempotencyKey: myOrderRef,
  onHold: () => keepForReview(myOrderRef),   // yours: do not place the order yet
});

What the answer means

  • summary.status is what the rules say across the states on the order. It never says an order is allowed or not allowed. Your clinician or pharmacist decides.
  • Each line quotes the rule with the agency, the link and the date we read it. Show those, not only the status.
  • checked: false means Provkeep could not check it. Nothing is held.

Testing

Photon's sandbox is called Neutron. Pair it with a Provkeep pk_test_ key, which talks to sandbox.provkeep.com and its own database, so neither side records a live order.

Building for many clinics

Each clinic can connect its own Provkeep account through your Connect Provkeep button.