Clinical APIs

These APIs can be used to build prescribing workflows and orchestrate pharmacy fulfillment.


Ready to get started with Photon APIs or have questions about an integration? Reach out at hello@photon.health.

Contact

API Support

support@photon.health

Terms of Service

photon.health/terms

API Endpoints
https://api.photon.health/graphql
Headers
# Token from auth.photon.health
Authorization: <access_token>

Queries

allergens

Description

Get list of allergens, filtered optionally by name (fuzzy search)

Response

Returns [Allergen]

Arguments
Name Description
filter - AllergenFilter

Example

Query
query allergens($filter: AllergenFilter) {
  allergens(filter: $filter) {
    id
    name
    rxcui
  }
}
Variables
{"filter": AllergenFilter}
Response
{
  "data": {
    "allergens": [
      {
        "id": "4",
        "name": "abc123",
        "rxcui": "4"
      }
    ]
  }
}

catalog

Description

Get a catalog by id

Response

Returns a Catalog

Arguments
Name Description
id - ID

Example

Query
query catalog($id: ID) {
  catalog(id: $id) {
    id
    name
    treatments {
      ...TreatmentFragment
    }
    templates {
      ...PrescriptionTemplateFragment
    }
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "catalog": {
      "id": "4",
      "name": "abc123",
      "treatments": [Treatment],
      "templates": [PrescriptionTemplate]
    }
  }
}

catalogs

Description

Get catalogs associated with caller's organization

Response

Returns [Catalog]!

Example

Query
query catalogs {
  catalogs {
    id
    name
    treatments {
      ...TreatmentFragment
    }
    templates {
      ...PrescriptionTemplateFragment
    }
  }
}
Response
{
  "data": {
    "catalogs": [
      {
        "id": 4,
        "name": "abc123",
        "treatments": [Treatment],
        "templates": [PrescriptionTemplate]
      }
    ]
  }
}

dispenseUnits

Description

Get list of Dispense Units for use in creating a prescription

Response

Returns [DispenseUnit]!

Example

Query
query dispenseUnits {
  dispenseUnits {
    name
  }
}
Response
{
  "data": {
    "dispenseUnits": [{"name": "xyz789"}]
  }
}

fill

Description

Get a fill

Response

Returns a Fill

Arguments
Name Description
id - ID! ID of the requested fill

Example

Query
query fill($id: ID!) {
  fill(id: $id) {
    id
    treatment {
      ...TreatmentFragment
    }
    prescription {
      ...PrescriptionFragment
    }
    state
    requestedAt
    filledAt
    order {
      ...OrderFragment
    }
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "fill": {
      "id": "4",
      "treatment": Treatment,
      "prescription": Prescription,
      "state": "SCHEDULED",
      "requestedAt": AWSDateTime,
      "filledAt": AWSDateTime,
      "order": Order
    }
  }
}

medicalEquipment

Description

Get list of Medical Equipment

Response

Returns [MedicalEquipment]!

Arguments
Name Description
name - String
after - ID
first - Int

Example

Query
query medicalEquipment(
  $name: String,
  $after: ID,
  $first: Int
) {
  medicalEquipment(
    name: $name,
    after: $after,
    first: $first
  ) {
    id
    name
    codes {
      ...TreatmentCodesFragment
    }
    description
  }
}
Variables
{"name": "xyz789", "after": 4, "first": 987}
Response
{
  "data": {
    "medicalEquipment": [
      {
        "id": "4",
        "name": "abc123",
        "codes": TreatmentCodes,
        "description": "xyz789"
      }
    ]
  }
}

medicationConcepts

Description

Get list of SearchMedication concepts that contain the specified name

Response

Returns [SearchMedication]

Arguments
Name Description
name - String!

Example

Query
query medicationConcepts($name: String!) {
  medicationConcepts(name: $name) {
    id
    name
    type
  }
}
Variables
{"name": "abc123"}
Response
{
  "data": {
    "medicationConcepts": [
      {
        "id": 4,
        "name": "xyz789",
        "type": "CONCEPT"
      }
    ]
  }
}

medicationForms

Description

Get list of forms related to a SearchMedication of type ROUTE. These are returned as prescribable medications

Response

Returns [Medication]

Arguments
Name Description
id - String!

Example

Query
query medicationForms($id: String!) {
  medicationForms(id: $id) {
    id
    name
    codes {
      ...TreatmentCodesFragment
    }
    type
    concept
    schedule
    controlled
    brandName
    genericName
    strength
    form
    manufacturer
    description
  }
}
Variables
{"id": "abc123"}
Response
{
  "data": {
    "medicationForms": [
      {
        "id": "4",
        "name": "xyz789",
        "codes": TreatmentCodes,
        "type": "RX",
        "concept": "DRUG",
        "schedule": "I",
        "controlled": true,
        "brandName": "abc123",
        "genericName": "xyz789",
        "strength": "xyz789",
        "form": "xyz789",
        "manufacturer": "xyz789",
        "description": "abc123"
      }
    ]
  }
}

medicationPackages

Description

Get list of Medicationn packages related to a Medication of type PRODUCT

Response

Returns [Medication]

Arguments
Name Description
id - String!

Example

Query
query medicationPackages($id: String!) {
  medicationPackages(id: $id) {
    id
    name
    codes {
      ...TreatmentCodesFragment
    }
    type
    concept
    schedule
    controlled
    brandName
    genericName
    strength
    form
    manufacturer
    description
  }
}
Variables
{"id": "xyz789"}
Response
{
  "data": {
    "medicationPackages": [
      {
        "id": 4,
        "name": "abc123",
        "codes": TreatmentCodes,
        "type": "RX",
        "concept": "DRUG",
        "schedule": "I",
        "controlled": true,
        "brandName": "abc123",
        "genericName": "abc123",
        "strength": "xyz789",
        "form": "abc123",
        "manufacturer": "xyz789",
        "description": "abc123"
      }
    ]
  }
}

medicationProducts

Description

Get list of Medication products related to a Medication of type DRUG

Response

Returns [Medication]

Arguments
Name Description
id - String!

Example

Query
query medicationProducts($id: String!) {
  medicationProducts(id: $id) {
    id
    name
    codes {
      ...TreatmentCodesFragment
    }
    type
    concept
    schedule
    controlled
    brandName
    genericName
    strength
    form
    manufacturer
    description
  }
}
Variables
{"id": "xyz789"}
Response
{
  "data": {
    "medicationProducts": [
      {
        "id": 4,
        "name": "xyz789",
        "codes": TreatmentCodes,
        "type": "RX",
        "concept": "DRUG",
        "schedule": "I",
        "controlled": true,
        "brandName": "abc123",
        "genericName": "abc123",
        "strength": "xyz789",
        "form": "xyz789",
        "manufacturer": "xyz789",
        "description": "abc123"
      }
    ]
  }
}

medicationRoutes

Description

Get list of routes related to a SearchMedication of type STRENGTH

Response

Returns [SearchMedication]

Arguments
Name Description
id - String!

Example

Query
query medicationRoutes($id: String!) {
  medicationRoutes(id: $id) {
    id
    name
    type
  }
}
Variables
{"id": "abc123"}
Response
{
  "data": {
    "medicationRoutes": [
      {
        "id": "4",
        "name": "abc123",
        "type": "CONCEPT"
      }
    ]
  }
}

medicationStrengths

Description

Get list of strengths related to a SearchMedication of type CONCEPT

Response

Returns [SearchMedication]

Arguments
Name Description
id - String!

Example

Query
query medicationStrengths($id: String!) {
  medicationStrengths(id: $id) {
    id
    name
    type
  }
}
Variables
{"id": "xyz789"}
Response
{
  "data": {
    "medicationStrengths": [
      {
        "id": 4,
        "name": "xyz789",
        "type": "CONCEPT"
      }
    ]
  }
}

medications

Description

Get list of medications

Response

Returns [Medication]!

Arguments
Name Description
filter - MedicationFilter Filter 'Medication' by name (partial string), type (RX or OTC), or code (RxCUI, NDC, SKU)
after - ID Supports forward pagination using first and optionally an after cursor to define where to begin
first - Int

Example

Query
query medications(
  $filter: MedicationFilter,
  $after: ID,
  $first: Int
) {
  medications(
    filter: $filter,
    after: $after,
    first: $first
  ) {
    id
    name
    codes {
      ...TreatmentCodesFragment
    }
    type
    concept
    schedule
    controlled
    brandName
    genericName
    strength
    form
    manufacturer
    description
  }
}
Variables
{
  "filter": MedicationFilter,
  "after": "4",
  "first": 123
}
Response
{
  "data": {
    "medications": [
      {
        "id": 4,
        "name": "abc123",
        "codes": TreatmentCodes,
        "type": "RX",
        "concept": "DRUG",
        "schedule": "I",
        "controlled": false,
        "brandName": "xyz789",
        "genericName": "xyz789",
        "strength": "abc123",
        "form": "abc123",
        "manufacturer": "abc123",
        "description": "abc123"
      }
    ]
  }
}

order

Description

Get an order by ID

Response

Returns an Order

Arguments
Name Description
id - ID! ID of the requested order

Example

Query
query order($id: ID!) {
  order(id: $id) {
    id
    externalId
    state
    fills {
      ...FillFragment
    }
    address {
      ...AddressFragment
    }
    patient {
      ...PatientFragment
    }
    pharmacy {
      ...PharmacyFragment
    }
    createdAt
    fulfillment {
      ...OrderFulfillmentFragment
    }
  }
}
Variables
{"id": "4"}
Response
{
  "data": {
    "order": {
      "id": 4,
      "externalId": "4",
      "state": "ROUTING",
      "fills": [Fill],
      "address": Address,
      "patient": Patient,
      "pharmacy": Pharmacy,
      "createdAt": AWSDateTime,
      "fulfillment": OrderFulfillment
    }
  }
}

orders

Description

Get all orders for a patient

Response

Returns [Order]!

Arguments
Name Description
filter - OrderFilter Filter 'Order' by patientId and order state
after - ID Supports forward pagination using first and optionally an after cursor to define where to begin
first - Int

Example

Query
query orders(
  $filter: OrderFilter,
  $after: ID,
  $first: Int
) {
  orders(
    filter: $filter,
    after: $after,
    first: $first
  ) {
    id
    externalId
    state
    fills {
      ...FillFragment
    }
    address {
      ...AddressFragment
    }
    patient {
      ...PatientFragment
    }
    pharmacy {
      ...PharmacyFragment
    }
    createdAt
    fulfillment {
      ...OrderFulfillmentFragment
    }
  }
}
Variables
{"filter": OrderFilter, "after": 4, "first": 123}
Response
{
  "data": {
    "orders": [
      {
        "id": 4,
        "externalId": "4",
        "state": "ROUTING",
        "fills": [Fill],
        "address": Address,
        "patient": Patient,
        "pharmacy": Pharmacy,
        "createdAt": AWSDateTime,
        "fulfillment": OrderFulfillment
      }
    ]
  }
}

patient

Description

Get a patient by ID

Response

Returns a Patient

Arguments
Name Description
id - ID! ID of the requested patient

Example

Query
query patient($id: ID!) {
  patient(id: $id) {
    id
    externalId
    name {
      ...NameFragment
    }
    dateOfBirth
    sex
    gender
    email
    phone
    allergies {
      ...PatientAllergyFragment
    }
    medicationHistory {
      ...PatientMedicationFragment
    }
    address {
      ...AddressFragment
    }
    prescriptions {
      ...PrescriptionFragment
    }
    orders {
      ...OrderFragment
    }
    preferredPharmacies {
      ...PharmacyFragment
    }
  }
}
Variables
{"id": "4"}
Response
{
  "data": {
    "patient": {
      "id": 4,
      "externalId": "4",
      "name": Name,
      "dateOfBirth": AWSDate,
      "sex": "MALE",
      "gender": "xyz789",
      "email": AWSEmail,
      "phone": AWSPhone,
      "allergies": [PatientAllergy],
      "medicationHistory": [PatientMedication],
      "address": Address,
      "prescriptions": [Prescription],
      "orders": [Order],
      "preferredPharmacies": [Pharmacy]
    }
  }
}

patients

Description

Get all patients associated with caller's organization

Response

Returns [Patient]!

Arguments
Name Description
filter - PatientFilter Filter 'Patient' by name of patient
after - ID Supports forward pagination using first and optionally an after cursor to define where to begin
first - Int

Example

Query
query patients(
  $filter: PatientFilter,
  $after: ID,
  $first: Int
) {
  patients(
    filter: $filter,
    after: $after,
    first: $first
  ) {
    id
    externalId
    name {
      ...NameFragment
    }
    dateOfBirth
    sex
    gender
    email
    phone
    allergies {
      ...PatientAllergyFragment
    }
    medicationHistory {
      ...PatientMedicationFragment
    }
    address {
      ...AddressFragment
    }
    prescriptions {
      ...PrescriptionFragment
    }
    orders {
      ...OrderFragment
    }
    preferredPharmacies {
      ...PharmacyFragment
    }
  }
}
Variables
{
  "filter": PatientFilter,
  "after": "4",
  "first": 987
}
Response
{
  "data": {
    "patients": [
      {
        "id": "4",
        "externalId": 4,
        "name": Name,
        "dateOfBirth": AWSDate,
        "sex": "MALE",
        "gender": "abc123",
        "email": AWSEmail,
        "phone": AWSPhone,
        "allergies": [PatientAllergy],
        "medicationHistory": [PatientMedication],
        "address": Address,
        "prescriptions": [Prescription],
        "orders": [Order],
        "preferredPharmacies": [Pharmacy]
      }
    ]
  }
}

pharmacies

Description

Search pharmacies

Response

Returns [Pharmacy]!

Arguments
Name Description
name - String Value to filter results by
location - LatLongSearch Latitude and longitude with a search radius in miles
type - FulfillmentType Type of pharmacy to filter by. Default = PICK_UP
after - Int Supports forward pagination, offset/limit style
first - Int

Example

Query
query pharmacies(
  $name: String,
  $location: LatLongSearch,
  $type: FulfillmentType,
  $after: Int,
  $first: Int
) {
  pharmacies(
    name: $name,
    location: $location,
    type: $type,
    after: $after,
    first: $first
  ) {
    id
    name
    name2
    NPI
    NCPDP
    address {
      ...AddressFragment
    }
    fax
    phone
    fulfillmentTypes
  }
}
Variables
{
  "name": "abc123",
  "location": LatLongSearch,
  "type": "PICK_UP",
  "after": 123,
  "first": 123
}
Response
{
  "data": {
    "pharmacies": [
      {
        "id": "4",
        "name": "abc123",
        "name2": "abc123",
        "NPI": "abc123",
        "NCPDP": "abc123",
        "address": Address,
        "fax": AWSPhone,
        "phone": AWSPhone,
        "fulfillmentTypes": ["PICK_UP"]
      }
    ]
  }
}

pharmacy

Description

Get a pharmacy by ID

Response

Returns a Pharmacy

Arguments
Name Description
id - ID! ID of the requested pharmacy

Example

Query
query pharmacy($id: ID!) {
  pharmacy(id: $id) {
    id
    name
    name2
    NPI
    NCPDP
    address {
      ...AddressFragment
    }
    fax
    phone
    fulfillmentTypes
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "pharmacy": {
      "id": "4",
      "name": "xyz789",
      "name2": "xyz789",
      "NPI": "abc123",
      "NCPDP": "abc123",
      "address": Address,
      "fax": AWSPhone,
      "phone": AWSPhone,
      "fulfillmentTypes": ["PICK_UP"]
    }
  }
}

prescription

Description

Get a prescription by ID

Response

Returns a Prescription

Arguments
Name Description
id - ID! ID of the requested prescription

Example

Query
query prescription($id: ID!) {
  prescription(id: $id) {
    id
    externalId
    prescriber {
      ...ProviderFragment
    }
    patient {
      ...PatientFragment
    }
    state
    treatment {
      ...TreatmentFragment
    }
    dispenseAsWritten
    dispenseQuantity
    dispenseUnit
    refillsAllowed
    refillsRemaining
    fillsAllowed
    fillsRemaining
    daysSupply
    instructions
    notes
    diagnoses {
      ...DiagnosisFragment
    }
    effectiveDate
    expirationDate
    writtenAt
    fills {
      ...FillFragment
    }
  }
}
Variables
{"id": "4"}
Response
{
  "data": {
    "prescription": {
      "id": 4,
      "externalId": "4",
      "prescriber": Provider,
      "patient": Patient,
      "state": "ACTIVE",
      "treatment": Treatment,
      "dispenseAsWritten": false,
      "dispenseQuantity": 123.45,
      "dispenseUnit": "abc123",
      "refillsAllowed": 123,
      "refillsRemaining": 123,
      "fillsAllowed": 987,
      "fillsRemaining": 123,
      "daysSupply": 123,
      "instructions": "abc123",
      "notes": "xyz789",
      "diagnoses": [Diagnosis],
      "effectiveDate": AWSDate,
      "expirationDate": AWSDate,
      "writtenAt": AWSDateTime,
      "fills": [Fill]
    }
  }
}

prescriptions

Description

Get all prescriptions associated with caller's organization

Response

Returns [Prescription]!

Arguments
Name Description
filter - PrescriptionFilter Filter 'Prescription' by id of patient, id of prescriber, and/or state
after - ID Supports forward pagination using first and optionally an after cursor to define where to begin
first - Int

Example

Query
query prescriptions(
  $filter: PrescriptionFilter,
  $after: ID,
  $first: Int
) {
  prescriptions(
    filter: $filter,
    after: $after,
    first: $first
  ) {
    id
    externalId
    prescriber {
      ...ProviderFragment
    }
    patient {
      ...PatientFragment
    }
    state
    treatment {
      ...TreatmentFragment
    }
    dispenseAsWritten
    dispenseQuantity
    dispenseUnit
    refillsAllowed
    refillsRemaining
    fillsAllowed
    fillsRemaining
    daysSupply
    instructions
    notes
    diagnoses {
      ...DiagnosisFragment
    }
    effectiveDate
    expirationDate
    writtenAt
    fills {
      ...FillFragment
    }
  }
}
Variables
{"filter": PrescriptionFilter, "after": 4, "first": 123}
Response
{
  "data": {
    "prescriptions": [
      {
        "id": 4,
        "externalId": 4,
        "prescriber": Provider,
        "patient": Patient,
        "state": "ACTIVE",
        "treatment": Treatment,
        "dispenseAsWritten": false,
        "dispenseQuantity": 123.45,
        "dispenseUnit": "abc123",
        "refillsAllowed": 123,
        "refillsRemaining": 987,
        "fillsAllowed": 123,
        "fillsRemaining": 123,
        "daysSupply": 987,
        "instructions": "xyz789",
        "notes": "abc123",
        "diagnoses": [Diagnosis],
        "effectiveDate": AWSDate,
        "expirationDate": AWSDate,
        "writtenAt": AWSDateTime,
        "fills": [Fill]
      }
    ]
  }
}

Mutations

addToCatalog

Response

Returns a Treatment!

Arguments
Name Description
catalogId - ID! ID of catalog to add to
treatmentId - ID! A Photon Treatment ID that references a medication or medication equipment

Example

Query
mutation addToCatalog(
  $catalogId: ID!,
  $treatmentId: ID!
) {
  addToCatalog(
    catalogId: $catalogId,
    treatmentId: $treatmentId
  ) {
    id
    name
    codes {
      ...TreatmentCodesFragment
    }
    description
  }
}
Variables
{"catalogId": 4, "treatmentId": "4"}
Response
{
  "data": {
    "addToCatalog": {
      "id": "4",
      "name": "xyz789",
      "codes": TreatmentCodes,
      "description": "abc123"
    }
  }
}

cancelOrder

Description

Cancel an Order, only works for those of fulfillment type MAIL_ORDER

Response

Returns an Order!

Arguments
Name Description
id - ID!

Example

Query
mutation cancelOrder($id: ID!) {
  cancelOrder(id: $id) {
    id
    externalId
    state
    fills {
      ...FillFragment
    }
    address {
      ...AddressFragment
    }
    patient {
      ...PatientFragment
    }
    pharmacy {
      ...PharmacyFragment
    }
    createdAt
    fulfillment {
      ...OrderFulfillmentFragment
    }
  }
}
Variables
{"id": "4"}
Response
{
  "data": {
    "cancelOrder": {
      "id": "4",
      "externalId": "4",
      "state": "ROUTING",
      "fills": [Fill],
      "address": Address,
      "patient": Patient,
      "pharmacy": Pharmacy,
      "createdAt": AWSDateTime,
      "fulfillment": OrderFulfillment
    }
  }
}

cancelPrescription

Description

Cancel a Prescription, stopping any remaining fills from being used in an order

Response

Returns a Prescription!

Arguments
Name Description
id - ID!

Example

Query
mutation cancelPrescription($id: ID!) {
  cancelPrescription(id: $id) {
    id
    externalId
    prescriber {
      ...ProviderFragment
    }
    patient {
      ...PatientFragment
    }
    state
    treatment {
      ...TreatmentFragment
    }
    dispenseAsWritten
    dispenseQuantity
    dispenseUnit
    refillsAllowed
    refillsRemaining
    fillsAllowed
    fillsRemaining
    daysSupply
    instructions
    notes
    diagnoses {
      ...DiagnosisFragment
    }
    effectiveDate
    expirationDate
    writtenAt
    fills {
      ...FillFragment
    }
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "cancelPrescription": {
      "id": 4,
      "externalId": 4,
      "prescriber": Provider,
      "patient": Patient,
      "state": "ACTIVE",
      "treatment": Treatment,
      "dispenseAsWritten": false,
      "dispenseQuantity": 987.65,
      "dispenseUnit": "xyz789",
      "refillsAllowed": 987,
      "refillsRemaining": 123,
      "fillsAllowed": 123,
      "fillsRemaining": 987,
      "daysSupply": 123,
      "instructions": "abc123",
      "notes": "abc123",
      "diagnoses": [Diagnosis],
      "effectiveDate": AWSDate,
      "expirationDate": AWSDate,
      "writtenAt": AWSDateTime,
      "fills": [Fill]
    }
  }
}

createOrder

Description

Create a new Order for a specific Patient

Response

Returns an Order!

Arguments
Name Description
externalId - ID Reference ID for linking to external objects
patientId - ID! ID of the patient that this order belongs to
fills - [FillInput!]! List of Rx or OTCs to be filled
address - AddressInput! Address where an order should be delivered
pharmacyId - ID ID of filling pharmacy (optional)

Example

Query
mutation createOrder(
  $externalId: ID,
  $patientId: ID!,
  $fills: [FillInput!]!,
  $address: AddressInput!,
  $pharmacyId: ID
) {
  createOrder(
    externalId: $externalId,
    patientId: $patientId,
    fills: $fills,
    address: $address,
    pharmacyId: $pharmacyId
  ) {
    id
    externalId
    state
    fills {
      ...FillFragment
    }
    address {
      ...AddressFragment
    }
    patient {
      ...PatientFragment
    }
    pharmacy {
      ...PharmacyFragment
    }
    createdAt
    fulfillment {
      ...OrderFulfillmentFragment
    }
  }
}
Variables
{
  "externalId": 4,
  "patientId": "4",
  "fills": [FillInput],
  "address": AddressInput,
  "pharmacyId": 4
}
Response
{
  "data": {
    "createOrder": {
      "id": 4,
      "externalId": "4",
      "state": "ROUTING",
      "fills": [Fill],
      "address": Address,
      "patient": Patient,
      "pharmacy": Pharmacy,
      "createdAt": AWSDateTime,
      "fulfillment": OrderFulfillment
    }
  }
}

createPatient

Description

Create a new Patient record

Response

Returns a Patient!

Arguments
Name Description
externalId - ID Reference ID for linking to external objects
name - NameInput! Patient's full name
dateOfBirth - AWSDate! Patient's date of birth
sex - SexType! Patient's sex at birth
gender - String Patient's gender
email - AWSEmail Patient's email
phone - AWSPhone! Patient's phone
allergies - [AllergenInput] List of allergies identified by RxCUI
medicationHistory - [MedHistoryInput] List of medications a patient is taking identified by a Photon Medication id, a comment, and whether or not it's active (will append)
address - AddressInput Optional patient address to be used as default address for orders
preferredPharmacies - [ID] Optional list of ids of preferred pharmacies

Example

Query
mutation createPatient(
  $externalId: ID,
  $name: NameInput!,
  $dateOfBirth: AWSDate!,
  $sex: SexType!,
  $gender: String,
  $email: AWSEmail,
  $phone: AWSPhone!,
  $allergies: [AllergenInput],
  $medicationHistory: [MedHistoryInput],
  $address: AddressInput,
  $preferredPharmacies: [ID]
) {
  createPatient(
    externalId: $externalId,
    name: $name,
    dateOfBirth: $dateOfBirth,
    sex: $sex,
    gender: $gender,
    email: $email,
    phone: $phone,
    allergies: $allergies,
    medicationHistory: $medicationHistory,
    address: $address,
    preferredPharmacies: $preferredPharmacies
  ) {
    id
    externalId
    name {
      ...NameFragment
    }
    dateOfBirth
    sex
    gender
    email
    phone
    allergies {
      ...PatientAllergyFragment
    }
    medicationHistory {
      ...PatientMedicationFragment
    }
    address {
      ...AddressFragment
    }
    prescriptions {
      ...PrescriptionFragment
    }
    orders {
      ...OrderFragment
    }
    preferredPharmacies {
      ...PharmacyFragment
    }
  }
}
Variables
{
  "externalId": 4,
  "name": NameInput,
  "dateOfBirth": AWSDate,
  "sex": "MALE",
  "gender": "xyz789",
  "email": AWSEmail,
  "phone": AWSPhone,
  "allergies": [AllergenInput],
  "medicationHistory": [MedHistoryInput],
  "address": AddressInput,
  "preferredPharmacies": ["4"]
}
Response
{
  "data": {
    "createPatient": {
      "id": 4,
      "externalId": "4",
      "name": Name,
      "dateOfBirth": AWSDate,
      "sex": "MALE",
      "gender": "abc123",
      "email": AWSEmail,
      "phone": AWSPhone,
      "allergies": [PatientAllergy],
      "medicationHistory": [PatientMedication],
      "address": Address,
      "prescriptions": [Prescription],
      "orders": [Order],
      "preferredPharmacies": [Pharmacy]
    }
  }
}

createPrescription

Description

Create a new Prescription associated with the logged in prescriber. A patientId is returned after creating a Patient with the createPatient mutation. treatmentId can be searched with the medications or medicalEquipment queries.

Response

Returns a Prescription!

Arguments
Name Description
externalId - ID Reference ID for linking to external objects
patientId - ID! ID of the patient that this prescription belongs to
treatmentId - ID! ID of the treatment being prescribed
dispenseAsWritten - Boolean True if substitutes are not allowed at the pharmacy
dispenseQuantity - Float! Amount of a dispenseUnit per fill
dispenseUnit - String! Unit to dispense treatment in
refillsAllowed - Int Number of refills allowed before expiration of script. DEPRECATED: Please use fillsAllowed instead for total number of fills.
fillsAllowed - Int Number of fills allowed before expiration of script
daysSupply - Int Number of days a single fill lasts
instructions - String! Prescriber instructions for patient
notes - String Prescriber notes, available to pharmacist
effectiveDate - AWSDate Date when the script is first valid
diagnoses - [ID] ICD10 codes for patient diagnosises

Example

Query
mutation createPrescription(
  $externalId: ID,
  $patientId: ID!,
  $treatmentId: ID!,
  $dispenseAsWritten: Boolean,
  $dispenseQuantity: Float!,
  $dispenseUnit: String!,
  $refillsAllowed: Int,
  $fillsAllowed: Int,
  $daysSupply: Int,
  $instructions: String!,
  $notes: String,
  $effectiveDate: AWSDate,
  $diagnoses: [ID]
) {
  createPrescription(
    externalId: $externalId,
    patientId: $patientId,
    treatmentId: $treatmentId,
    dispenseAsWritten: $dispenseAsWritten,
    dispenseQuantity: $dispenseQuantity,
    dispenseUnit: $dispenseUnit,
    refillsAllowed: $refillsAllowed,
    fillsAllowed: $fillsAllowed,
    daysSupply: $daysSupply,
    instructions: $instructions,
    notes: $notes,
    effectiveDate: $effectiveDate,
    diagnoses: $diagnoses
  ) {
    id
    externalId
    prescriber {
      ...ProviderFragment
    }
    patient {
      ...PatientFragment
    }
    state
    treatment {
      ...TreatmentFragment
    }
    dispenseAsWritten
    dispenseQuantity
    dispenseUnit
    refillsAllowed
    refillsRemaining
    fillsAllowed
    fillsRemaining
    daysSupply
    instructions
    notes
    diagnoses {
      ...DiagnosisFragment
    }
    effectiveDate
    expirationDate
    writtenAt
    fills {
      ...FillFragment
    }
  }
}
Variables
{
  "externalId": "4",
  "patientId": "4",
  "treatmentId": 4,
  "dispenseAsWritten": false,
  "dispenseQuantity": 123.45,
  "dispenseUnit": "xyz789",
  "refillsAllowed": 123,
  "fillsAllowed": 123,
  "daysSupply": 987,
  "instructions": "xyz789",
  "notes": "abc123",
  "effectiveDate": AWSDate,
  "diagnoses": ["4"]
}
Response
{
  "data": {
    "createPrescription": {
      "id": "4",
      "externalId": "4",
      "prescriber": Provider,
      "patient": Patient,
      "state": "ACTIVE",
      "treatment": Treatment,
      "dispenseAsWritten": false,
      "dispenseQuantity": 987.65,
      "dispenseUnit": "abc123",
      "refillsAllowed": 123,
      "refillsRemaining": 123,
      "fillsAllowed": 987,
      "fillsRemaining": 123,
      "daysSupply": 123,
      "instructions": "xyz789",
      "notes": "xyz789",
      "diagnoses": [Diagnosis],
      "effectiveDate": AWSDate,
      "expirationDate": AWSDate,
      "writtenAt": AWSDateTime,
      "fills": [Fill]
    }
  }
}

createPrescriptionTemplate

Response

Returns a PrescriptionTemplate

Arguments
Name Description
catalogId - ID! ID of catalog to add to
name - String Display name for the template
treatmentId - ID! ID of the treatment being prescribed
dispenseAsWritten - Boolean True if substitutes are not allowed at the pharmacy
dispenseQuantity - Float Amount of a dispenseUnit per fill
dispenseUnit - String Unit to dispense treatment in
refillsAllowed - Int Number of refills allowed before expiration of script. DEPRECATED: Please use fillsAllowed instead for total number of fills.
fillsAllowed - Int Number of fills allowed before expiration of script
daysSupply - Int Number of days a single fill lasts
instructions - String Prescriber instructions for patient
notes - String Prescriber notes, available to pharmacist

Example

Query
mutation createPrescriptionTemplate(
  $catalogId: ID!,
  $name: String,
  $treatmentId: ID!,
  $dispenseAsWritten: Boolean,
  $dispenseQuantity: Float,
  $dispenseUnit: String,
  $refillsAllowed: Int,
  $fillsAllowed: Int,
  $daysSupply: Int,
  $instructions: String,
  $notes: String
) {
  createPrescriptionTemplate(
    catalogId: $catalogId,
    name: $name,
    treatmentId: $treatmentId,
    dispenseAsWritten: $dispenseAsWritten,
    dispenseQuantity: $dispenseQuantity,
    dispenseUnit: $dispenseUnit,
    refillsAllowed: $refillsAllowed,
    fillsAllowed: $fillsAllowed,
    daysSupply: $daysSupply,
    instructions: $instructions,
    notes: $notes
  ) {
    id
    name
    treatment {
      ...TreatmentFragment
    }
    dispenseAsWritten
    dispenseQuantity
    dispenseUnit
    refillsAllowed
    fillsAllowed
    daysSupply
    instructions
    notes
  }
}
Variables
{
  "catalogId": 4,
  "name": "abc123",
  "treatmentId": 4,
  "dispenseAsWritten": true,
  "dispenseQuantity": 123.45,
  "dispenseUnit": "abc123",
  "refillsAllowed": 987,
  "fillsAllowed": 987,
  "daysSupply": 987,
  "instructions": "abc123",
  "notes": "xyz789"
}
Response
{
  "data": {
    "createPrescriptionTemplate": {
      "id": 4,
      "name": "xyz789",
      "treatment": Treatment,
      "dispenseAsWritten": false,
      "dispenseQuantity": 987.65,
      "dispenseUnit": "abc123",
      "refillsAllowed": 987,
      "fillsAllowed": 987,
      "daysSupply": 123,
      "instructions": "abc123",
      "notes": "abc123"
    }
  }
}

createPrescriptions

Description

Creates multiple new Prescription associated with the logged in prescriber.

Response

Returns [Prescription]!

Arguments
Name Description
prescriptions - [PrescriptionInput]!

Example

Query
mutation createPrescriptions($prescriptions: [PrescriptionInput]!) {
  createPrescriptions(prescriptions: $prescriptions) {
    id
    externalId
    prescriber {
      ...ProviderFragment
    }
    patient {
      ...PatientFragment
    }
    state
    treatment {
      ...TreatmentFragment
    }
    dispenseAsWritten
    dispenseQuantity
    dispenseUnit
    refillsAllowed
    refillsRemaining
    fillsAllowed
    fillsRemaining
    daysSupply
    instructions
    notes
    diagnoses {
      ...DiagnosisFragment
    }
    effectiveDate
    expirationDate
    writtenAt
    fills {
      ...FillFragment
    }
  }
}
Variables
{"prescriptions": [PrescriptionInput]}
Response
{
  "data": {
    "createPrescriptions": [
      {
        "id": 4,
        "externalId": 4,
        "prescriber": Provider,
        "patient": Patient,
        "state": "ACTIVE",
        "treatment": Treatment,
        "dispenseAsWritten": false,
        "dispenseQuantity": 123.45,
        "dispenseUnit": "xyz789",
        "refillsAllowed": 987,
        "refillsRemaining": 987,
        "fillsAllowed": 123,
        "fillsRemaining": 987,
        "daysSupply": 987,
        "instructions": "abc123",
        "notes": "abc123",
        "diagnoses": [Diagnosis],
        "effectiveDate": AWSDate,
        "expirationDate": AWSDate,
        "writtenAt": AWSDateTime,
        "fills": [Fill]
      }
    ]
  }
}

deletePrescriptionTemplate

Response

Returns a PrescriptionTemplate!

Arguments
Name Description
catalogId - ID! ID of catalog to remove from
templateId - ID! An ID of a Photon Prescription Template to be removed

Example

Query
mutation deletePrescriptionTemplate(
  $catalogId: ID!,
  $templateId: ID!
) {
  deletePrescriptionTemplate(
    catalogId: $catalogId,
    templateId: $templateId
  ) {
    id
    name
    treatment {
      ...TreatmentFragment
    }
    dispenseAsWritten
    dispenseQuantity
    dispenseUnit
    refillsAllowed
    fillsAllowed
    daysSupply
    instructions
    notes
  }
}
Variables
{"catalogId": 4, "templateId": "4"}
Response
{
  "data": {
    "deletePrescriptionTemplate": {
      "id": 4,
      "name": "abc123",
      "treatment": Treatment,
      "dispenseAsWritten": false,
      "dispenseQuantity": 987.65,
      "dispenseUnit": "abc123",
      "refillsAllowed": 123,
      "fillsAllowed": 123,
      "daysSupply": 987,
      "instructions": "abc123",
      "notes": "xyz789"
    }
  }
}

removeFromCatalog

Response

Returns a Treatment!

Arguments
Name Description
catalogId - ID! ID of catalog to add to
treatmentId - ID! A Photon Treatment ID that references a medication or medication equipment

Example

Query
mutation removeFromCatalog(
  $catalogId: ID!,
  $treatmentId: ID!
) {
  removeFromCatalog(
    catalogId: $catalogId,
    treatmentId: $treatmentId
  ) {
    id
    name
    codes {
      ...TreatmentCodesFragment
    }
    description
  }
}
Variables
{
  "catalogId": "4",
  "treatmentId": "4"
}
Response
{
  "data": {
    "removeFromCatalog": {
      "id": "4",
      "name": "abc123",
      "codes": TreatmentCodes,
      "description": "abc123"
    }
  }
}

removePatientAllergy

Response

Returns a Patient!

Arguments
Name Description
id - ID! ID of the Patient record to remove from
allergenId - ID! ID of allergen to remove

Example

Query
mutation removePatientAllergy(
  $id: ID!,
  $allergenId: ID!
) {
  removePatientAllergy(
    id: $id,
    allergenId: $allergenId
  ) {
    id
    externalId
    name {
      ...NameFragment
    }
    dateOfBirth
    sex
    gender
    email
    phone
    allergies {
      ...PatientAllergyFragment
    }
    medicationHistory {
      ...PatientMedicationFragment
    }
    address {
      ...AddressFragment
    }
    prescriptions {
      ...PrescriptionFragment
    }
    orders {
      ...OrderFragment
    }
    preferredPharmacies {
      ...PharmacyFragment
    }
  }
}
Variables
{"id": 4, "allergenId": 4}
Response
{
  "data": {
    "removePatientAllergy": {
      "id": 4,
      "externalId": "4",
      "name": Name,
      "dateOfBirth": AWSDate,
      "sex": "MALE",
      "gender": "abc123",
      "email": AWSEmail,
      "phone": AWSPhone,
      "allergies": [PatientAllergy],
      "medicationHistory": [PatientMedication],
      "address": Address,
      "prescriptions": [Prescription],
      "orders": [Order],
      "preferredPharmacies": [Pharmacy]
    }
  }
}

removePatientPreferredPharmacy

Description

Removes a preferred pharmacy to a patient

Response

Returns a Patient!

Arguments
Name Description
patientId - ID! ID of the Patient to update
pharmacyId - ID! ID of the Pharmacy to add

Example

Query
mutation removePatientPreferredPharmacy(
  $patientId: ID!,
  $pharmacyId: ID!
) {
  removePatientPreferredPharmacy(
    patientId: $patientId,
    pharmacyId: $pharmacyId
  ) {
    id
    externalId
    name {
      ...NameFragment
    }
    dateOfBirth
    sex
    gender
    email
    phone
    allergies {
      ...PatientAllergyFragment
    }
    medicationHistory {
      ...PatientMedicationFragment
    }
    address {
      ...AddressFragment
    }
    prescriptions {
      ...PrescriptionFragment
    }
    orders {
      ...OrderFragment
    }
    preferredPharmacies {
      ...PharmacyFragment
    }
  }
}
Variables
{"patientId": 4, "pharmacyId": 4}
Response
{
  "data": {
    "removePatientPreferredPharmacy": {
      "id": 4,
      "externalId": 4,
      "name": Name,
      "dateOfBirth": AWSDate,
      "sex": "MALE",
      "gender": "abc123",
      "email": AWSEmail,
      "phone": AWSPhone,
      "allergies": [PatientAllergy],
      "medicationHistory": [PatientMedication],
      "address": Address,
      "prescriptions": [Prescription],
      "orders": [Order],
      "preferredPharmacies": [Pharmacy]
    }
  }
}

updateOrder

Description

Updates an existing Order record

Response

Returns an Order!

Arguments
Name Description
id - ID! ID of the Order to update
externalId - ID Reference ID for linking to external objects

Example

Query
mutation updateOrder(
  $id: ID!,
  $externalId: ID
) {
  updateOrder(
    id: $id,
    externalId: $externalId
  ) {
    id
    externalId
    state
    fills {
      ...FillFragment
    }
    address {
      ...AddressFragment
    }
    patient {
      ...PatientFragment
    }
    pharmacy {
      ...PharmacyFragment
    }
    createdAt
    fulfillment {
      ...OrderFulfillmentFragment
    }
  }
}
Variables
{"id": 4, "externalId": "4"}
Response
{
  "data": {
    "updateOrder": {
      "id": "4",
      "externalId": 4,
      "state": "ROUTING",
      "fills": [Fill],
      "address": Address,
      "patient": Patient,
      "pharmacy": Pharmacy,
      "createdAt": AWSDateTime,
      "fulfillment": OrderFulfillment
    }
  }
}

updatePatient

Description

Update an existing Patient record

Response

Returns a Patient!

Arguments
Name Description
id - ID! ID of the Patient to update
externalId - ID Reference ID for linking to external objects
name - NameInput Patient's full name
gender - String Patient's gender
dateOfBirth - AWSDate Patient's date of birth
sex - SexType Patient's sex at birth
email - AWSEmail Patient's email
phone - AWSPhone Patient's phone
allergies - [AllergenInput] List of allergies identified by RxCUI (will append)
medicationHistory - [MedHistoryInput] List of medications a patient is taking identified by a Photon Medication id, a comment, and whether or not it's active (will append)
address - AddressInput Optional patient address to be used as default address for orders
preferredPharmacies - [ID] Optional list of ids of preferred pharmacies to add

Example

Query
mutation updatePatient(
  $id: ID!,
  $externalId: ID,
  $name: NameInput,
  $gender: String,
  $dateOfBirth: AWSDate,
  $sex: SexType,
  $email: AWSEmail,
  $phone: AWSPhone,
  $allergies: [AllergenInput],
  $medicationHistory: [MedHistoryInput],
  $address: AddressInput,
  $preferredPharmacies: [ID]
) {
  updatePatient(
    id: $id,
    externalId: $externalId,
    name: $name,
    gender: $gender,
    dateOfBirth: $dateOfBirth,
    sex: $sex,
    email: $email,
    phone: $phone,
    allergies: $allergies,
    medicationHistory: $medicationHistory,
    address: $address,
    preferredPharmacies: $preferredPharmacies
  ) {
    id
    externalId
    name {
      ...NameFragment
    }
    dateOfBirth
    sex
    gender
    email
    phone
    allergies {
      ...PatientAllergyFragment
    }
    medicationHistory {
      ...PatientMedicationFragment
    }
    address {
      ...AddressFragment
    }
    prescriptions {
      ...PrescriptionFragment
    }
    orders {
      ...OrderFragment
    }
    preferredPharmacies {
      ...PharmacyFragment
    }
  }
}
Variables
{
  "id": 4,
  "externalId": "4",
  "name": NameInput,
  "gender": "xyz789",
  "dateOfBirth": AWSDate,
  "sex": "MALE",
  "email": AWSEmail,
  "phone": AWSPhone,
  "allergies": [AllergenInput],
  "medicationHistory": [MedHistoryInput],
  "address": AddressInput,
  "preferredPharmacies": ["4"]
}
Response
{
  "data": {
    "updatePatient": {
      "id": 4,
      "externalId": "4",
      "name": Name,
      "dateOfBirth": AWSDate,
      "sex": "MALE",
      "gender": "xyz789",
      "email": AWSEmail,
      "phone": AWSPhone,
      "allergies": [PatientAllergy],
      "medicationHistory": [PatientMedication],
      "address": Address,
      "prescriptions": [Prescription],
      "orders": [Order],
      "preferredPharmacies": [Pharmacy]
    }
  }
}

updatePrescriptionTemplate

Response

Returns a PrescriptionTemplate

Arguments
Name Description
catalogId - ID! ID of catalog to add to
name - String Display name for the template
templateId - ID! An ID of a Photon Prescription Template to be updated
dispenseAsWritten - Boolean True if substitutes are not allowed at the pharmacy
dispenseQuantity - Float Amount of a dispenseUnit per fill
dispenseUnit - String Unit to dispense treatment in
fillsAllowed - Int Number of fills allowed before expiration of script
daysSupply - Int Number of days a single fill lasts
instructions - String Prescriber instructions for patient
notes - String Prescriber notes, available to pharmacist

Example

Query
mutation updatePrescriptionTemplate(
  $catalogId: ID!,
  $name: String,
  $templateId: ID!,
  $dispenseAsWritten: Boolean,
  $dispenseQuantity: Float,
  $dispenseUnit: String,
  $fillsAllowed: Int,
  $daysSupply: Int,
  $instructions: String,
  $notes: String
) {
  updatePrescriptionTemplate(
    catalogId: $catalogId,
    name: $name,
    templateId: $templateId,
    dispenseAsWritten: $dispenseAsWritten,
    dispenseQuantity: $dispenseQuantity,
    dispenseUnit: $dispenseUnit,
    fillsAllowed: $fillsAllowed,
    daysSupply: $daysSupply,
    instructions: $instructions,
    notes: $notes
  ) {
    id
    name
    treatment {
      ...TreatmentFragment
    }
    dispenseAsWritten
    dispenseQuantity
    dispenseUnit
    refillsAllowed
    fillsAllowed
    daysSupply
    instructions
    notes
  }
}
Variables
{
  "catalogId": 4,
  "name": "abc123",
  "templateId": "4",
  "dispenseAsWritten": true,
  "dispenseQuantity": 987.65,
  "dispenseUnit": "xyz789",
  "fillsAllowed": 123,
  "daysSupply": 987,
  "instructions": "xyz789",
  "notes": "abc123"
}
Response
{
  "data": {
    "updatePrescriptionTemplate": {
      "id": 4,
      "name": "abc123",
      "treatment": Treatment,
      "dispenseAsWritten": true,
      "dispenseQuantity": 123.45,
      "dispenseUnit": "xyz789",
      "refillsAllowed": 987,
      "fillsAllowed": 123,
      "daysSupply": 987,
      "instructions": "xyz789",
      "notes": "xyz789"
    }
  }
}

Types

AWSDate

Description

An extended ISO 8601 date string in the format YYYY-MM-DD.

Example
AWSDate

AWSDateTime

Description

An extended ISO 8601 date and time string in the format YYYY-MM-DDThh:mm:ss.sssZ.

Example
AWSDateTime

AWSEmail

Description

An email address in the format local-part@domain-part as defined by RFC 822.

Example
AWSEmail

AWSPhone

Description

A phone number. This value is stored as a string. Phone numbers can contain either spaces or hyphens to separate digit groups. Phone numbers without a country code are assumed to be US/North American numbers adhering to the North American Numbering Plan (NANP).

Example
AWSPhone

Address

Fields
Field Name Description
name - Name
street1 - String!
street2 - String
postalCode - String!
country - String!
state - String!
city - String!
Example
{
  "name": Name,
  "street1": "abc123",
  "street2": "abc123",
  "postalCode": "abc123",
  "country": "xyz789",
  "state": "xyz789",
  "city": "abc123"
}

AddressInput

Fields
Input Field Description
name - NameInput
street1 - String!
street2 - String
postalCode - String!
country - String!
state - String!
city - String!
Example
{
  "name": NameInput,
  "street1": "xyz789",
  "street2": "xyz789",
  "postalCode": "abc123",
  "country": "xyz789",
  "state": "abc123",
  "city": "xyz789"
}

Allergen

Fields
Field Name Description
id - ID!
name - String!
rxcui - ID
Example
{
  "id": 4,
  "name": "xyz789",
  "rxcui": "4"
}

AllergenFilter

Fields
Input Field Description
name - String
Example
{"name": "xyz789"}

AllergenInput

Fields
Input Field Description
allergenId - ID!
comment - String
onset - AWSDate
Example
{
  "allergenId": "4",
  "comment": "xyz789",
  "onset": AWSDate
}

Boolean

Description

The Boolean scalar type represents true or false.

Example
true

Catalog

Fields
Field Name Description
id - ID!
name - String!
treatments - [Treatment]!
templates - [PrescriptionTemplate]!
Example
{
  "id": 4,
  "name": "xyz789",
  "treatments": [Treatment],
  "templates": [PrescriptionTemplate]
}

Compound

Fields
Field Name Description
id - ID!
name - String!
codes - TreatmentCodes!
description - String
Example
{
  "id": 4,
  "name": "xyz789",
  "codes": TreatmentCodes,
  "description": "abc123"
}

ConceptType

Values
Enum Value Description

DRUG

PRODUCT

PACKAGE

Example
"DRUG"

Diagnosis

Fields
Field Name Description
type - DiagnosisType!
code - String!
name - String!
Example
{
  "type": "ICD10",
  "code": "abc123",
  "name": "abc123"
}

DiagnosisType

Values
Enum Value Description

ICD10

Example
"ICD10"

DispenseUnit

Fields
Field Name Description
name - String!
Example
{"name": "xyz789"}

DrugFilter

Fields
Input Field Description
name - String
code - String
Example
{
  "name": "abc123",
  "code": "xyz789"
}

Fill

Fields
Field Name Description
id - ID!
treatment - Treatment!
prescription - Prescription
state - FillState!
requestedAt - AWSDateTime!
filledAt - AWSDateTime
order - Order!
Example
{
  "id": "4",
  "treatment": Treatment,
  "prescription": Prescription,
  "state": "SCHEDULED",
  "requestedAt": AWSDateTime,
  "filledAt": AWSDateTime,
  "order": Order
}

FillInput

Fields
Input Field Description
treatmentId - ID ID of a Treatment (optional if prescriptionId is set)
prescriptionId - ID ID of a Prescription (optional for OTCs)
Example
{"treatmentId": "4", "prescriptionId": 4}

FillState

Values
Enum Value Description

SCHEDULED

NEW

SENT

CANCELED

Example
"SCHEDULED"

Float

Description

The Float scalar type represents signed double-precision fractional values as specified by IEEE 754.

Example
123.45

FulfillmentType

Values
Enum Value Description

PICK_UP

MAIL_ORDER

Example
"PICK_UP"

ID

Description

The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.

Example
4

Int

Description

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

Example
987

LatLongSearch

Fields
Input Field Description
latitude - Float
longitude - Float
radius - Int Search radius in miles
Example
{"latitude": 987.65, "longitude": 123.45, "radius": 123}

MedHistoryInput

Fields
Input Field Description
medicationId - ID!
active - Boolean!
comment - String
Example
{
  "medicationId": "4",
  "active": false,
  "comment": "abc123"
}

MedicalEquipment

Fields
Field Name Description
id - ID!
name - String!
codes - TreatmentCodes!
description - String
Example
{
  "id": 4,
  "name": "xyz789",
  "codes": TreatmentCodes,
  "description": "xyz789"
}

Medication

Fields
Field Name Description
id - ID!
name - String!
codes - TreatmentCodes!
type - MedicationType Null implies a medication cant be prescribed
concept - ConceptType!
schedule - ScheduleType
controlled - Boolean!
brandName - String
genericName - String
strength - String
form - String
manufacturer - String
description - String
Example
{
  "id": "4",
  "name": "xyz789",
  "codes": TreatmentCodes,
  "type": "RX",
  "concept": "DRUG",
  "schedule": "I",
  "controlled": true,
  "brandName": "abc123",
  "genericName": "abc123",
  "strength": "abc123",
  "form": "abc123",
  "manufacturer": "abc123",
  "description": "abc123"
}

MedicationFilter

Fields
Input Field Description
drug - DrugFilter
product - ProductFilter
package - PackageFilter
Example
{
  "drug": DrugFilter,
  "product": ProductFilter,
  "package": PackageFilter
}

MedicationType

Values
Enum Value Description

RX

Prescription

OTC

Over-the-Counter
Example
"RX"

Name

Fields
Field Name Description
full - String! Convenience method for getting a formated name
title - String
first - String!
middle - String
last - String!
Example
{
  "full": "abc123",
  "title": "abc123",
  "first": "abc123",
  "middle": "abc123",
  "last": "xyz789"
}

NameInput

Fields
Input Field Description
title - String
first - String!
middle - String
last - String!
Example
{
  "title": "abc123",
  "first": "abc123",
  "middle": "xyz789",
  "last": "xyz789"
}

Order

Fields
Field Name Description
id - ID!
externalId - ID
state - OrderState!
fills - [Fill!]!
address - Address
patient - Patient!
pharmacy - Pharmacy The pharmacy that owns this Order
createdAt - AWSDateTime!
fulfillment - OrderFulfillment
Example
{
  "id": "4",
  "externalId": "4",
  "state": "ROUTING",
  "fills": [Fill],
  "address": Address,
  "patient": Patient,
  "pharmacy": Pharmacy,
  "createdAt": AWSDateTime,
  "fulfillment": OrderFulfillment
}

OrderFilter

Fields
Input Field Description
patientId - ID
patientName - String
state - OrderState
Example
{
  "patientId": 4,
  "patientName": "xyz789",
  "state": "ROUTING"
}

OrderFulfillment

Fields
Field Name Description
type - FulfillmentType!
state - String!
carrier - String
trackingNumber - String
Example
{
  "type": "PICK_UP",
  "state": "abc123",
  "carrier": "abc123",
  "trackingNumber": "abc123"
}

OrderState

Values
Enum Value Description

ROUTING

PENDING

PLACED

COMPLETED

CANCELED

ERROR

Example
"ROUTING"

OrgType

Values
Enum Value Description

PRESCRIBER

PHARMACY

Example
"PRESCRIBER"

Organization

Fields
Field Name Description
id - ID!
name - String!
type - OrgType
NPI - String
address - Address
fax - AWSPhone
phone - AWSPhone
email - AWSEmail
Example
{
  "id": 4,
  "name": "xyz789",
  "type": "PRESCRIBER",
  "NPI": "xyz789",
  "address": Address,
  "fax": AWSPhone,
  "phone": AWSPhone,
  "email": AWSEmail
}

PackageFilter

Fields
Input Field Description
name - String
product - ID!
code - String
type - MedicationType
Example
{
  "name": "abc123",
  "product": "4",
  "code": "xyz789",
  "type": "RX"
}

Patient

Fields
Field Name Description
id - ID!
externalId - ID
name - Name!
dateOfBirth - AWSDate!
sex - SexType!
gender - String
email - AWSEmail
phone - AWSPhone!
allergies - [PatientAllergy]
medicationHistory - [PatientMedication]
address - Address
prescriptions - [Prescription]
Arguments
after - ID

Supports forward pagination using first and optionally an after cursor to define where to begin

first - Int
orders - [Order]
Arguments
after - ID
first - Int
preferredPharmacies - [Pharmacy]
Example
{
  "id": "4",
  "externalId": "4",
  "name": Name,
  "dateOfBirth": AWSDate,
  "sex": "MALE",
  "gender": "abc123",
  "email": AWSEmail,
  "phone": AWSPhone,
  "allergies": [PatientAllergy],
  "medicationHistory": [PatientMedication],
  "address": Address,
  "prescriptions": [Prescription],
  "orders": [Order],
  "preferredPharmacies": [Pharmacy]
}

PatientAllergy

Fields
Field Name Description
allergen - Allergen!
comment - String
onset - AWSDate
Example
{
  "allergen": Allergen,
  "comment": "xyz789",
  "onset": AWSDate
}

PatientFilter

Fields
Input Field Description
name - String
Example
{"name": "abc123"}

PatientMedication

Fields
Field Name Description
prescription - Prescription
medication - Medication!
comment - String
active - Boolean!
Example
{
  "prescription": Prescription,
  "medication": Medication,
  "comment": "abc123",
  "active": true
}

PatientOrderFilter

Fields
Input Field Description
state - OrderState
Example
{"state": "ROUTING"}

PatientPrescriptionFilter

Fields
Input Field Description
state - PrescriptionState
prescriberId - ID
Example
{"state": "ACTIVE", "prescriberId": "4"}

Pharmacy

Fields
Field Name Description
id - ID!
name - String!
name2 - String
NPI - String
NCPDP - String
address - Address
fax - AWSPhone
phone - AWSPhone
fulfillmentTypes - [FulfillmentType]
Example
{
  "id": 4,
  "name": "xyz789",
  "name2": "xyz789",
  "NPI": "abc123",
  "NCPDP": "xyz789",
  "address": Address,
  "fax": AWSPhone,
  "phone": AWSPhone,
  "fulfillmentTypes": ["PICK_UP"]
}

Prescription

Fields
Field Name Description
id - ID!
externalId - ID
prescriber - Provider!
patient - Patient!
state - PrescriptionState!
treatment - Treatment!
dispenseAsWritten - Boolean
dispenseQuantity - Float!
dispenseUnit - String!
refillsAllowed - Int!
refillsRemaining - Int!
fillsAllowed - Int!
fillsRemaining - Int!
daysSupply - Int
instructions - String!
notes - String
diagnoses - [Diagnosis]
effectiveDate - AWSDate!
expirationDate - AWSDate!
writtenAt - AWSDateTime!
fills - [Fill]!
Example
{
  "id": 4,
  "externalId": "4",
  "prescriber": Provider,
  "patient": Patient,
  "state": "ACTIVE",
  "treatment": Treatment,
  "dispenseAsWritten": false,
  "dispenseQuantity": 123.45,
  "dispenseUnit": "abc123",
  "refillsAllowed": 987,
  "refillsRemaining": 987,
  "fillsAllowed": 123,
  "fillsRemaining": 123,
  "daysSupply": 987,
  "instructions": "xyz789",
  "notes": "xyz789",
  "diagnoses": [Diagnosis],
  "effectiveDate": AWSDate,
  "expirationDate": AWSDate,
  "writtenAt": AWSDateTime,
  "fills": [Fill]
}

PrescriptionFilter

Fields
Input Field Description
state - PrescriptionState
patientId - ID
patientName - String
prescriberId - ID
Example
{
  "state": "ACTIVE",
  "patientId": "4",
  "patientName": "abc123",
  "prescriberId": 4
}

PrescriptionInput

Fields
Input Field Description
externalId - ID Reference ID for linking to external objects
patientId - ID! ID of the patient that this prescription belongs to
treatmentId - ID! ID of the treatment being prescribed
dispenseAsWritten - Boolean True if substitutes are not allowed at the pharmacy
dispenseQuantity - Float! Amount of a dispenseUnit per fill
dispenseUnit - String! Unit to dispense treatment in
refillsAllowed - Int Number of refills allowed before expiration of script. DEPRECATED: Please use fillsAllowed instead for total number of fills.
fillsAllowed - Int Number of fills allowed before expiration of script
daysSupply - Int Number of days a single fill lasts
instructions - String! Prescriber instructions for patient
notes - String Prescriber notes, available to pharmacist
effectiveDate - AWSDate Date when the script is first valid
diagnoses - [ID] ICD10 codes for patient diagnosises
Example
{
  "externalId": 4,
  "patientId": 4,
  "treatmentId": "4",
  "dispenseAsWritten": false,
  "dispenseQuantity": 123.45,
  "dispenseUnit": "xyz789",
  "refillsAllowed": 987,
  "fillsAllowed": 123,
  "daysSupply": 987,
  "instructions": "abc123",
  "notes": "xyz789",
  "effectiveDate": AWSDate,
  "diagnoses": ["4"]
}

PrescriptionState

Values
Enum Value Description

ACTIVE

EXPIRED

DEPLETED

CANCELED

Example
"ACTIVE"

PrescriptionTemplate

Fields
Field Name Description
id - ID!
name - String
treatment - Treatment!
dispenseAsWritten - Boolean
dispenseQuantity - Float
dispenseUnit - String
refillsAllowed - Int
fillsAllowed - Int
daysSupply - Int
instructions - String
notes - String
Example
{
  "id": "4",
  "name": "xyz789",
  "treatment": Treatment,
  "dispenseAsWritten": true,
  "dispenseQuantity": 123.45,
  "dispenseUnit": "xyz789",
  "refillsAllowed": 987,
  "fillsAllowed": 123,
  "daysSupply": 987,
  "instructions": "abc123",
  "notes": "xyz789"
}

ProductFilter

Fields
Input Field Description
name - String
drug - ID!
code - String
type - MedicationType
Example
{
  "name": "xyz789",
  "drug": 4,
  "code": "abc123",
  "type": "RX"
}

Provider

Fields
Field Name Description
id - ID!
externalId - ID
name - Name!
email - AWSEmail!
phone - AWSPhone!
fax - AWSPhone
address - Address
organizations - [Organization!]!
NPI - String
Example
{
  "id": 4,
  "externalId": "4",
  "name": Name,
  "email": AWSEmail,
  "phone": AWSPhone,
  "fax": AWSPhone,
  "address": Address,
  "organizations": [Organization],
  "NPI": "xyz789"
}

ScheduleType

Values
Enum Value Description

I

II

III

IV

V

Example
"I"

SearchMedication

Fields
Field Name Description
id - ID!
name - String!
type - SearchMedicationType
Example
{
  "id": "4",
  "name": "abc123",
  "type": "CONCEPT"
}

SearchMedicationType

Values
Enum Value Description

CONCEPT

STRENGTH

ROUTE

FORM

Example
"CONCEPT"

SexType

Values
Enum Value Description

MALE

FEMALE

UNKNOWN

Example
"MALE"

String

Description

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Example
"xyz789"

Treatment

Fields
Field Name Description
id - ID!
name - String!
codes - TreatmentCodes!
description - String
Possible Types
Treatment Types

MedicalEquipment

Medication

Compound

Example
{
  "id": 4,
  "name": "xyz789",
  "codes": TreatmentCodes,
  "description": "abc123"
}

TreatmentCodes

Fields
Field Name Description
rxcui - String
productNDC - String
packageNDC - String
SKU - String
HCPCS - String
Example
{
  "rxcui": "xyz789",
  "productNDC": "xyz789",
  "packageNDC": "abc123",
  "SKU": "xyz789",
  "HCPCS": "xyz789"
}