While we do not expect many changes to this API, it is subject to change with notice.
The PatchRx Connect API can be used to integrate prescription adherence data generated by PatchRx devices into many applications.
We highly recommend reading through our integration guide(s). There are two of them, so the best place to start is here.
Integrating PatchRx technology can look a different depending on the intended application, so PatchRx offers two suggested paths to API integration.
Below is a chart detailing the main feature differences between the two pathways. For more detail on each path and tips for choosing between them, see each path's respective section:
If you're unsure which path is best, we are happy to advise!
In this pathway, the integrating partner only needs to activate and deactivate devices. After activation, the devices begin recording data that can be simply queried using device identifiers. If desired, the integrating partner can still leverage PatchRx's native inventory management system, device management, and ordering capabilities. This is the fastest way to integrate.
Consider choosing this path if some or all of the following apply...
Below is a high-level overview of how you might implement the PatchRx API (Light Path) in a production environment. Think of this as a typical workflow; you can adjust to your specific use-case or constraints.
Before reading through the guide's steps, it's helpful to familiarize yourself with PatchRx's data model.
Organizationally, PatchRx customers are Partners, and each partner can have 1:N Health Entity Locations (HELs). These HELs are used to represent different sites in a multi-site implementation. For the light integration, having more than 1 is optional. They are only necessary if you intend to leverage PatchRx's inventory management system. If not, it's acceptable to create a single monolithic HEL.
In this integration path, the only other objects invoved are the Devices, Gateways and PatchCaps, which are associated with HELs after shipment.
Obtain API key(s) and PatchRx webapp access
Reach out to your PatchRx representative to get your API keys and webapp access.
Your API requests must include the custom header:
x-api-key: <YOUR_KEY_HERE>
Login to the webapp
Login to the PatchRx webapp and familiarize yourself. In the Light integration path, the only relevant parts of the webapp are the
Inventory and Locations tabs, as you won't be working with patients/prescriptions & billing.
Here is a quick-use guide that explains how to use
the webapp.
Test your key(s)
You can verify that your API key is working by testing any GET endpoint with your key.
For example, GET /all_health_entity_locations
:
curl --location 'https://external.patchrx.io/all_health_entity_locations' --header 'x-api-key: <your API key>'
You should get a 200 response and a list of HELs for your partner account.
If your implementation doesn't require multi-site inventory managment, skip to section B below.
PatchRx's software has a built-in inventory management system. This system enables partners to monitor inventory levels across their health entity locations, track distribution rates, and conduct periodic audits and updates.
The IMS is built around health entity locations (HELs). Inventory flows as follows:
System setup
If you plan to leverage this system, you'll need to create health entity locations for each site where you'd like to track inventory.
GET /all_health_entity_locations
POST /health_entity_location
endpoint to create any new locationsManaging and viewing inventory
In the event that you transfer inventory between health entity locations, or if inventory is lost/destroyed, you'll need to use API calls to keep the PatchRx IMS up to date.
(calls to view and manage inventory coming soon)
Inventory can be ordered via the PatchRx webapp inventory tab.
Note: If the actions block is not visible, reach out to your PatchRx representative to enable & configure ordering for your account.
In production, users will instead use the "Order inventory" button to place orders for cases of inventory rather than individual demo units.
Once you have devices, all that's needed to begin receiving data from them is activation via the API and physical setup.
To get devices online and request their data, simply follow steps 1-4 below.
PUT /activate_gateway
(coming soon, see note)PUT /patchcap_distributed
(coming soon, see note)GET /patchcap_data
(coming soon, see note)Note: These endpoints are not yet live, but can be brought online in short order if you are interested in the Light integration path.
To discontinue connectivity-related billing, Gateways must be deactivated when they are no longer used. However, they are reusable, provided that the patient returns them with their accessories and they are in clean, working order.
PUT /deactivate_gateway
with returned = true
, which will:PUT /deactivate_gateway
with returned = false
, which will:If a patient returns a device that is not reusable (missing accessories, etc.), PatchRx has a recycling & rebate program. Reach out to your PatchRx representative for more information.
Note: These endpoints are not yet live, but can be brought online in short order if you are interested in the Light integration path.
In this pathway, the integrating partner will create patients and prescriptions in the PatchRx environment before associating and assigning devices to them. This is a more involved integration pathway, but enables use of the PatchRx webapp for monitoring and managing patients and their devices. Additionally, it allows for automated code completion tracking.
Consider choosing this path if some or all of the following apply...
Below is a high-level overview of how you might implement the PatchRx API in a production environment. Think of this as a typical workflow; you can adjust to your specific use-case or constraints. Before reading through the guide's steps, it's helpful to familiarize yourself with PatchRx's data model.
Organizationally, PatchRx customers are Partners, and each partner can have 1:N Health Entity Locations (HELs). These HELs are used to represent different sites in a multi-site implementation. Patients are organized underneath HELs, as each HEL can have 0:N patients. Patients themselves can have 0:N Prescriptions and 0:N Devices (PatchCaps & Gateways). Gateways are associated with the Patient, while PatchCaps are assigned to the Patient's Prescriptions.
Obtain API key(s) and PatchRx webapp access
Reach out to your PatchRx representative to get your API keys and webapp access.
Your API requests must include the custom header:
x-api-key: <YOUR_KEY_HERE>
Login to the webapp
Login to the PatchRx webapp and familiarize yourself.
Here is a quick-use guide that explains how to use it.
Test your key(s)
You can verify that your API key is working by testing any GET endpoint using cURL.
For example, GET /all_health_entity_locations
:
curl --location 'https://external.patchrx.io/all_health_entity_locations' --header 'x-api-key: <your API key>'
You should get a 200 response and a list of HELs for your partner account.
Health entity locations are the key organizational block in PatchRx's data model. Patients and inventory are organized underneath them, and webapp user permissions are scoped by association with them (for more on permissions, see here).
For multi-site implementations, we recommend creating health entity locations for each physical site, as it makes managing patient populations easier and facilitates the use of PatchRx's inventory management system. The inventory management system enables partners to monitor inventory levels across their health entity locations, track distribution rates, and conduct periodic audits and updates.
Inventory flows as follows:
If you plan to leverage this system, or would like to cleanly segment patient populations by location, you'll need to create health entity locations for each respective location. For your integration, you can manage this manually or setup a trigger to create new locations in PatchRx upon creation in your application.
If you don't wish to leverage the benefits of multiple HELs, you can proceed with a single default HEL for organizing all patients and inventory.
GET /all_health_entity_locations
POST /health_entity_location
endpoint to create any new locationsInventory can be ordered via the PatchRx webapp inventory tab.
Note: If the actions block is not visible, reach out to your PatchRx representative to enable & configure ordering for your account.
When your integration is in production, users will instead use the "Order inventory" button to place orders for cases of inventory rather than individual demo units.
In the event that you transfer inventory between health entity locations, or if inventory is lost/destroyed, you'll need to use API calls to keep the PatchRx IMS up to date.
(calls to view and manage inventory coming soon)
Once you have set up your health entity locations, ordered inventory, and that inventory has shipped, the inventory chart on the inventory tab should be updated to reflect that those units are now in stock and ready to be associated with patients / assigned to prescriptions.
PatchRx has two types of devices: PatchCaps and Gateways.
Gateways are relay devices that sync data from PatchCaps and send it to the cloud via cellular connection. It is required to associate Gateways with patients, as it enables the device's SIM. If it's not associated with a patient, the device is inert and will not sync data.
PatchCaps are the sensors responsible for actually measuring the bottle openings and closings. To support polypharmacy situations, they are assigned to patient's prescriptions.
To get a patient set up for monitoring, you'll need to do the following in order:
Because PatchCaps are disposable and have a limited lifespan (>120 days), it will be necessary to repeat step 4 each time they get a replacement. If their prescription changes, it will be necessary to repeat steps 2 and 4.
We typically recommend completing steps 1-4 all at once upon patient enrollment in your application, but in some cases partners may make the calls separately.
Note: throughout these docs, we use "associate" to refer to the creation of a relationship between device and patient. "Assign" is used to refer to the creation of a relationship between a device and a prescription.
1. Creating Patients
POST /patient
id
field2. Creating Prescriptions
POST /prescription
3. Associate Gateway
PUT /associate_gateway
to associate it with them4. Assign PatchCap
PUT /assign_patchcap
to assign it to their respective prescriptionOnce steps 1-4 are complete, the patient only needs to plug in their Gateway, affix their PatchCap, and pull its activation tab (see setup). From thereon, the sytem should passively record their openings and make that data available via API.
Currently, opening events are retrieved via a single API call: GET /bottle_opens
, which will return a list of a given patient's
opening events, tagged with the prescription ID, medication name, device serial, and event time.
The full integration path does allow for patient monitoring via the PatchRx webapp.
Temporarily Disabled. In the future, GET /patient_patchcap_connectivity
will provide heartbeat-driven connectivity metrics (e.g., "online" vs. "offline").
A small portion of patients will inevitably discontinue their monitoring program. In that event, it's important to clean up their PatchRx records to facilitate device reuse and avoid unnecessary billing charges.
Gateways are reusable (provided they still have their accessories and are in clean, working order).
If the patient returns a reusable device, use the PUT /unassociate_gateway
call to unassociate the Gateway from the discontinuing patient
and disable its SIM. Then use PUT /patient
to update the patient's state to "archived". These calls will:
If the patient does NOT return a reusable device, simply use PUT /patient
to update the patient's state to "archived". This will:
If a patient returns a device that is not reusable (missing accessories, etc.), PatchRx has a recycling & rebate program. Reach out to your PatchRx representative for more information.
API connections have full partner-scoped permissions, meaning they can create, update, and read from any entities created underneath their partner.
Webapp users have health-entity-location-scoped permissions, meaning their abilities are limited by which health entity locations they're associated. For more detail, see the users endpoints.
Some entities support creation and reference using external identifiers. This means that you can use your organization's unique identifiers in lieu of PatchRx's generated identifiers. Doing so is optional, and PatchRx will generate unique identifiers if they are not provided. Currently, this is supported for health entity locations, patients, and prescriptions.
PatchRx uses a tiered structure for grouping patients. Organizations using the API are Partners. Each partner may have 1:N Health Entity Location(s).
These locations are used for managing patients and inventory in multi-site applications.
Creates a heath entity location.
id | string (HealthEntityLocationId) Unique health entity location id; assigned by PatchRx if none provided upon creation |
name required | string (HealthEntityLocationName) Name of the health entity location |
{- "id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "name": "Jane's Pharmacies, Toledo"
}
{- "id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "name": "Jane's Pharmacies, Toledo",
- "is_active": true
}
Get info for a single health entity location.
id required | string (HealthEntityLocationId) Example: id=047abd65-c1d0-4a31-b715-cf2cfa0bda33 Unique health entity location id; assigned by PatchRx if none provided upon creation |
[- {
- "id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "name": "Jane's Pharmacies, Toledo",
- "is_active": true
}
]
Update health entity location information.
id required | string (HealthEntityLocationId) Example: id=047abd65-c1d0-4a31-b715-cf2cfa0bda33 Unique health entity location id; assigned by PatchRx if none provided upon creation |
name | string (HealthEntityLocationName) Name of the health entity location |
is_active | boolean (IsActive) Whether the given entity is active |
{- "name": "Jane's Pharmacies, Toledo",
- "is_active": true
}
{- "id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "name": "Jane's Pharmacies, Toledo",
- "is_active": true
}
The patients endpoint is used for creating and managing parallel representations of patients.
Get a list of all patients for the requesting partner
[- {
- "id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "first_name": "John",
- "last_name": "Doe",
- "nickname": "JD",
- "dob": "1968-03-24",
- "phone": "+16171111111",
- "health_entity_location_id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "practitioner_id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "patient_state": "enrolled",
- "timezone": "America/New_York"
}
]
Add a patient to PatchRx. Each created patient must have a unique combination of first_name
, last_name
, and dob
,
or else a duplicate patient error will be raised.
id | string <uuid> (PatientId) Unique patient id; assigned by PatchRx if none provided upon creation |
first_name required | string (FirstName) First name |
last_name required | string (LastName) Last name |
health_entity_location_id required | string (HealthEntityLocationId) Unique health entity location id; assigned by PatchRx if none provided upon creation |
dob required | string <date> (DateOfBirth) Date of birth in YYYY-MM-DD format |
timezone required | string (Timezone) Timezone as a postgresql timezone abbreviation or name |
phone | string <phone> (PhoneNumber) Phone number, including country code |
nickname | string (Nickname) Nickname |
practitioner_id | string (UserId) Unique user id; assigned by PatchRx (external ids not currently supported) |
{- "id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "first_name": "John",
- "last_name": "Doe",
- "health_entity_location_id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "dob": "1968-03-24",
- "timezone": "America/New_York",
- "phone": "+16171111111",
- "nickname": "JD",
- "practitioner_id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33"
}
{- "id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "first_name": "John",
- "last_name": "Doe",
- "nickname": "JD",
- "dob": "1968-03-24",
- "phone": "+16171111111",
- "health_entity_location_id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "practitioner_id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "patient_state": "enrolled",
- "timezone": "America/New_York"
}
Given a patient's unique id, retrieve their information.
id required | string <uuid> (PatientId) Example: id=047abd65-c1d0-4a31-b715-cf2cfa0bda33 Unique patient id; assigned by PatchRx if none provided upon creation |
{- "id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "first_name": "John",
- "last_name": "Doe",
- "nickname": "JD",
- "dob": "1968-03-24",
- "phone": "+16171111111",
- "health_entity_location_id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "practitioner_id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "patient_state": "enrolled",
- "timezone": "America/New_York"
}
Given a patient id, update any patient info.
id required | string <uuid> (PatientId) Example: id=047abd65-c1d0-4a31-b715-cf2cfa0bda33 Unique patient id; assigned by PatchRx if none provided upon creation |
first_name | string (FirstName) First name |
last_name | string (LastName) Last name |
nickname | string (Nickname) Nickname |
health_entity_location_id | string (HealthEntityLocationId) Unique health entity location id; assigned by PatchRx if none provided upon creation |
practitioner_id | string (UserId) Unique user id; assigned by PatchRx (external ids not currently supported) |
dob | string <date> (DateOfBirth) Date of birth in YYYY-MM-DD format |
phone | string <phone> (PhoneNumber) Phone number, including country code |
patient_state | string (PatientState) Enum: "enrolled" "archived" The patient's state, new patients default to |
timezone | string (Timezone) Timezone as a postgresql timezone abbreviation or name |
{- "first_name": "John",
- "last_name": "Doe",
- "nickname": "JD",
- "health_entity_location_id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "practitioner_id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "dob": "1968-03-24",
- "phone": "+16171111111",
- "patient_state": "enrolled",
- "timezone": "America/New_York"
}
{- "id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "first_name": "John",
- "last_name": "Doe",
- "nickname": "JD",
- "dob": "1968-03-24",
- "phone": "+16171111111",
- "health_entity_location_id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "practitioner_id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "patient_state": "enrolled",
- "timezone": "America/New_York"
}
The prescriptions endpoint is used for creating and managing parallel representations of patient's prescriptions.
Patients can have multiple prescriptions, and each prescription can have multiple PatchCaps as they're used and replaced.
Get all prescriptions for a given patient
id required | string <uuid> (PatientId) Example: id=047abd65-c1d0-4a31-b715-cf2cfa0bda33 Unique patient id; assigned by PatchRx if none provided upon creation |
[- {
- "id": "233e765d-ecf3-4c3f-9a69-0acb87b76814",
- "patient_id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "state": "archived",
- "rxcui": "310965",
- "rxstring": "Advil 200MG Oral Tablet",
- "alternate_drug_id": "12345678",
- "alternate_commercial_name": "Aspirin",
- "alternate_drug_strength": "100mg",
- "provider_instructions": "string",
- "dosing_device": "Standard pharmacy pill bottle"
}
]
Create a prescription for a given patient. PatchRx uses the National Library of Medicine's RxNorm as our main drug database. If you use an RXCUI (RxNorm Concept Unique Identifier), PatchRx will automatically use the mapped RxString information from RxNorm in any PatchRx UI.
However, if you need to use an alternate identifier (e.g. NDC or DIN), use the corresponding request format and PatchRx systems will attempt to map the provided identifier to RxNorm. As these mappings are not always 100% accurate, you can optionally provide an alternate commercial name and drug strength, which will be displayed in any PatchRx UI instead of the mapped values to ensure consistency across systems.
id | string (PrescriptionId) Unique prescription id; assigned by PatchRx if none provided upon creation |
patient_id required | string <uuid> (PatientId) Unique patient id; assigned by PatchRx if none provided upon creation |
rxcui required | string (RXCUI) A unique identifier assigned to an individual drug entity in RxNorm |
alternate_commercial_name | string (AlternateCommercialName) The drug's commercial name Provide this field if you'd like to ensure this name is displayed in the PatchRx UI, otherwise, the mapped RxNorm RxString will be used |
alternate_drug_strength | string (AlternateDrugStrength) The drug's strength Provide this field if you'd like to ensure this strength is displayed in the PatchRx UI, but note that alternate commercial name must be provided for this field to be used Omit this field if the drug's strength is included in the alternate commercial name (otherwise it will be listed twice) |
state | string (PrescriptionState) Enum: "archived" "monitored" The prescription's state, defaults to monitored for newly created prescriptions |
provider_instructions | string (ProviderInstructions) Any instructions given by the provider |
dosing_device | string (DosingDevice) Enum: "Standard pharmacy pill bottle" "Secondary pill bottle" "Pill tray - simple" "Pill tray - smart tech enabled" "Pill dispenser" "Other" The primary dispensing/storage device being used by the patient |
{- "id": "233e765d-ecf3-4c3f-9a69-0acb87b76814",
- "patient_id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "rxcui": "310965",
- "alternate_commercial_name": "Aspirin",
- "alternate_drug_strength": "100mg",
- "state": "archived",
- "provider_instructions": "string",
- "dosing_device": "Standard pharmacy pill bottle"
}
{- "id": "233e765d-ecf3-4c3f-9a69-0acb87b76814",
- "patient_id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "state": "archived",
- "rxcui": "310965",
- "rxstring": "Advil 200MG Oral Tablet",
- "alternate_drug_id": "12345678",
- "alternate_commercial_name": "Aspirin",
- "alternate_drug_strength": "100mg",
- "provider_instructions": "string",
- "dosing_device": "Standard pharmacy pill bottle"
}
Get all prescription info given a prescription id.
id required | string (PrescriptionId) Example: id=233e765d-ecf3-4c3f-9a69-0acb87b76814 Unique prescription id; assigned by PatchRx if none provided upon creation |
{- "id": "233e765d-ecf3-4c3f-9a69-0acb87b76814",
- "patient_id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "state": "archived",
- "rxcui": "310965",
- "rxstring": "Advil 200MG Oral Tablet",
- "alternate_drug_id": "12345678",
- "alternate_commercial_name": "Aspirin",
- "alternate_drug_strength": "100mg",
- "provider_instructions": "string",
- "dosing_device": "Standard pharmacy pill bottle"
}
Update prescription information for a given prescription id. Use empty strings to clear any fields.
id required | string (PrescriptionId) Example: id=233e765d-ecf3-4c3f-9a69-0acb87b76814 Unique prescription id; assigned by PatchRx if none provided upon creation |
state | string (PrescriptionState) Enum: "archived" "monitored" The prescription's state, defaults to monitored for newly created prescriptions |
rxcui | string (RXCUI) A unique identifier assigned to an individual drug entity in RxNorm |
provider_instructions | string (ProviderInstructions) Any instructions given by the provider |
dosing_device | string (DosingDevice) Enum: "Standard pharmacy pill bottle" "Secondary pill bottle" "Pill tray - simple" "Pill tray - smart tech enabled" "Pill dispenser" "Other" The primary dispensing/storage device being used by the patient |
{- "state": "archived",
- "rxcui": "310965",
- "provider_instructions": "string",
- "dosing_device": "Standard pharmacy pill bottle"
}
{- "id": "233e765d-ecf3-4c3f-9a69-0acb87b76814",
- "patient_id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "state": "archived",
- "rxcui": "310965",
- "rxstring": "Advil 200MG Oral Tablet",
- "alternate_drug_id": "12345678",
- "alternate_commercial_name": "Aspirin",
- "alternate_drug_strength": "100mg",
- "provider_instructions": "string",
- "dosing_device": "Standard pharmacy pill bottle"
}
The device endpoints are used for managing device <> patient, device <> prescription.
There are two types of devices, PatchCaps and Gateways.
PatchCaps are the actual pill bottle sensors, and are assigned to a patient's prescription. Gateways forward data from PatchCaps to the cloud, and are associated with the patient.
To get a patient's devices set up & ready to stream data, check out the relevant integration guide section:
Be sure to review the respective sections related to device return as well.
Note: PatchCaps can be associated with the patient, but PatchCap<>patient association is a weak relationship -- data is only reported from PatchCaps that have been assigned to a given prescription. For the purposes of the external API, it may make sense to skip PatchCap association and go straight to assignment.
Given a PatchCap's serial number, retrieve its information.
serial_number required | string (PatchCapSerialNumber) Example: serial_number=B030125 Unique PatchCap serial number, typically 7 characters starting with "B" |
{- "serial_number": "B030125",
- "gateway_id": "ABCD-ABCD-ABCD",
- "tenovi_link_id": "5a4fd28d-6c90-4bf5-b776-ef44b3109645",
- "first_event_time": "2019-08-24T14:15:22Z",
- "last_event_time": "2019-08-24T14:15:22Z",
- "battery_voltage": 3200,
- "rssi": -75,
- "prescription_id": "233e765d-ecf3-4c3f-9a69-0acb87b76814",
- "patient_id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33"
}
Given a Gateway's serial number, retrieve its information.
serial_number required | string (GatewaySerialNumber) Example: serial_number=A0000000 Unique Gateway serial number, typically 8 characters starting with "A" |
{- "gateway_id": "gw-123456",
- "serial_number": "A0000000",
- "patient_id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "device_version": "TC-GWY-A1",
- "firmware_version": "1.2.3",
- "first_seen": "2019-08-24T14:15:22Z",
- "last_seen": "2019-08-24T14:15:22Z",
- "rsrp": -95.5
}
This does NOT fully attach a PatchCap to a patient's prescription, but merely associates it to the patient. This is used to indicate that the patient has the device, but does not indicate which prescription it is attached to.
Assignment to their prescription is required for data to flow properly. Association is used when the patient is known to have the PatchCap, but there is uncertainty around which of their prescriptions it's being affixed to.
serial_number required | string (PatchCapSerialNumber) Example: serial_number=B030125 Unique PatchCap serial number, typically 7 characters starting with "B" |
patient_id required | string <uuid> (PatientId) Unique patient id; assigned by PatchRx if none provided upon creation |
{- "patient_id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33"
}
{- "patient_id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "serial_number": "B030125"
}
This connects a PatchCap to a patient's prescription. Use it when you are certain that the given PatchCap is being used to monitor the given prescription.
serial_number required | string (PatchCapSerialNumber) Example: serial_number=B030125 Unique PatchCap serial number, typically 7 characters starting with "B" |
prescription_id required | string (PrescriptionId) Unique prescription id; assigned by PatchRx if none provided upon creation |
{- "prescription_id": "233e765d-ecf3-4c3f-9a69-0acb87b76814"
}
{- "prescription_id": "233e765d-ecf3-4c3f-9a69-0acb87b76814",
- "serial_number": "B030125"
}
Associate a PatchRx Gateway with a patient. Although not required, this is recommended for all patients as it improves stockkeeping accuracy and makes troubleshooting easier.
serial_number required | string (GatewaySerialNumber) Example: serial_number=A0000000 Unique Gateway serial number, typically 8 characters starting with "A" |
patient_id required | string <uuid> (PatientId) Unique patient id; assigned by PatchRx if none provided upon creation |
{- "patient_id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33"
}
{- "patient_id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "serial_number": "A0000000"
}
Remove a PatchRx Gateway's association with a patient. This endpoint is useful when a Gateway needs to be reassigned to a different patient or retired from service.
serial_number required | string (GatewaySerialNumber) Example: serial_number=A0000000 Unique Gateway serial number, typically 8 characters starting with "A" |
{- "serial_number": "A0000000"
}
Given a patient id, get all of that patient's recorded bottle openings.
Future note: this will eventually include a mechanism to only provide data since a certain date or event id, to prevent pulling of redundant data.
patient_id required | string <uuid> (PatientId) Example: patient_id=047abd65-c1d0-4a31-b715-cf2cfa0bda33 Unique patient id; assigned by PatchRx if none provided upon creation |
start_time required | string <date-time> Example: start_time=2024-01-01T00:00:00Z The start time for the query range, inclusive |
end_time required | string <date-time> Example: end_time=2024-01-31T23:59:59Z The end time for the query range, inclusive |
[- {
- "prescription_id": "233e765d-ecf3-4c3f-9a69-0acb87b76814",
- "rxstring": "Advil 200MG Oral Tablet",
- "serial_number": "B030125",
- "combined_mac": "CF441EA2E487",
- "event_time": "2024-06-17T16:42:36Z"
}
]
NOTE: THIS ENDPOINT IS TEMPORARILY DISABLED
Given a patient id, get connectivity information for all of their prescriptions and PatchCaps during the given time period.
The last_seen
timestamp can be used to implicitly determine true negative time spans. In the absence of a bottle open event,
until a device heartbeat updates the last_seen
timestamp, it is ambiguous whether the bottle has been opened. Only for time
before last_seen
can we implicitly assume that there was no bottle opening.
patient_id required | string <uuid> (PatientId) Example: patient_id=047abd65-c1d0-4a31-b715-cf2cfa0bda33 Unique patient id; assigned by PatchRx if none provided upon creation |
start_date required | string <date> (StartDate) Example: start_date=2025-06-01 The start date for a given range, inclusive |
end_date required | string <date> (EndDate) Example: end_date=2025-06-30 The end date for a given range, inclusive |
[- {
- "prescription_id": "233e765d-ecf3-4c3f-9a69-0acb87b76814",
- "serial_number": "B030125",
- "combined_mac": "CF441EA2E487",
- "firmware_version": "v1.5.0",
- "connectivity": 0.93,
- "first_seen": "2024-06-01 10:31:33+00",
- "last_seen": "2024-06-17 16:42:36+00"
}
]
For debug use only
Create a PatchCap event (open, close, heartbeat, etc.). Note that the webapp will only display openings,
and that heartbeats (event_id=0
) will effect last seen timestamps.
combined_mac required | string (PatchCapMacAddress) Unique MAC address for the PatchCap device |
event_time required | string <date-time> (PatchCapEventTime) The time of the given event |
event_id required | number (PatchCapEventId) PatchRx event type; 0=heartbeat, 2=open, 3=close |
log_id required | number (PatchCapLogId) Incremental log id number for a given PatchCap, starts at 1 and increments everytime a PatchCap generates an event (will reset if PatchCap resets) |
gateway_id | string (GatewayId) Unique Gateway Id |
rssi | integer (PatchCapRssi) The RSSI of the PatchCap signal received by the Gateway |
battery_voltage | integer (PatchCapBattery) The remaining device battery in millivolts |
{- "combined_mac": "CF441EA2E487",
- "event_time": "2024-06-17T16:42:36Z",
- "event_id": 2,
- "log_id": 47,
- "gateway_id": "GW002_123456789012345",
- "rssi": -73,
- "battery_voltage": 2700
}
[- {
- "add_patch_cap_events": true
}
]
The users endpoints are used for creating, updating, and managing the permissions of PatchRx webapp users.
PatchRx webapp user permissions are scoped by their health entity location associations, so users are only able to see patients that are attached to the same health entity locations as themselves.
All users are able to create new users within the webapp, but they are only able to associate them with a subset of their own health entity location associations.
[- {
- "id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "first_name": "John",
- "last_name": "Doe",
- "email": "john.doe@example.com",
- "is_deleted": false,
- "health_entity_location_associations": [
- {
- "id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "name": "Jane's Pharmacies, Toledo"
}
]
}
]
Create a webapp user for the PatchRx webapp.
After creation, the user will need to verify their email address. After verification, they should be able to login using either Microsoft or Google federated logins. If a user/password login is required, please reach out to your PatchRx contact.
When you create a new user, you will need to provide an initial health entity location id via the
health_entity_location_id
field. This is the initial health entity location that they will be associated with.
Additional health entity location associations can be added via the associate user operation.
first_name required | string (FirstName) First name |
last_name required | string (LastName) Last name |
email required | string <email> (Email) A valid email address |
health_entity_location_id required | string (HealthEntityLocationId) Unique health entity location id; assigned by PatchRx if none provided upon creation |
{- "first_name": "John",
- "last_name": "Doe",
- "email": "john.doe@example.com",
- "health_entity_location_id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33"
}
{- "id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "first_name": "John",
- "last_name": "Doe",
- "email": "john.doe@example.com",
- "is_deleted": false,
- "health_entity_location_associations": [
- {
- "id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "name": "Jane's Pharmacies, Toledo"
}
]
}
Given a user id, get their webapp user info.
id required | string (UserId) Example: id=047abd65-c1d0-4a31-b715-cf2cfa0bda33 Unique user id; assigned by PatchRx (external ids not currently supported) |
{- "id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "first_name": "John",
- "last_name": "Doe",
- "email": "john.doe@example.com",
- "is_deleted": false,
- "health_entity_location_associations": [
- {
- "id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "name": "Jane's Pharmacies, Toledo"
}
]
}
Update a user's information for a given user id. Set is_deleted
to true
to
disable a given user's acess to the webapp.
Email is not currently updatable.
id required | string (UserId) Example: id=047abd65-c1d0-4a31-b715-cf2cfa0bda33 Unique user id; assigned by PatchRx (external ids not currently supported) |
first_name | string (FirstName) First name |
last_name | string (LastName) Last name |
is_deleted | boolean (IsDeleted) Whether the given entity is deleted |
{- "first_name": "John",
- "last_name": "Doe",
- "is_deleted": false
}
{- "id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "first_name": "John",
- "last_name": "Doe",
- "email": "john.doe@example.com",
- "is_deleted": false,
- "health_entity_location_associations": [
- {
- "id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33",
- "name": "Jane's Pharmacies, Toledo"
}
]
}
Associate a user with a health entity location.
User permissions are limited by these associations. For example, if a partner had two health entity locations, HEL A and HEL B, and the user was only associated with HEL A, they'd only be able to see data for patients at HEL A.
Note: The ability to dissociate a user from a health entity location is coming soon.
id required | string (UserId) Example: id=047abd65-c1d0-4a31-b715-cf2cfa0bda33 Unique user id; assigned by PatchRx (external ids not currently supported) |
health_entity_location_id required | string (HealthEntityLocationId) Unique health entity location id; assigned by PatchRx if none provided upon creation |
{- "health_entity_location_id": "047abd65-c1d0-4a31-b715-cf2cfa0bda33"
}
NOTE: Under construction
Given an order id, retrieve relevant information.
id required | string <uuid> (OrderId) Example: id=8eca5397-2257-4274-9d4d-3296ff6cb142 Unique patient order id, which is used to retrieve order information |
{- "id": "8eca5397-2257-4274-9d4d-3296ff6cb142",
- "shipments": [
- {
- "shipment_id": 100830149,
- "shipment_status": 100830149,
- "shipment_tracking_number": 1.2345678901234568e+28,
- "shipment_tracking_url": "https://webtrack.dhlglobalmail.com/?trackingnumber=012345678901234567890123456789"
}
]
}
Given a PatchCap's MAC address, retrieve its serial number.
serial_number required | string (PatchCapSerialNumber) Example: serial_number=B030125 Unique PatchCap serial number, typically 7 characters starting with "B" |
{- "combined_mac": "CF441EA2E487",
- "color": "R"
}
Given a PatchCap's serial number, retrieve its MAC address.
combined_mac required | string (PatchCapMacAddress) Example: combined_mac=CF441EA2E487 Unique MAC address for the PatchCap device |
{- "serial_number": "B030125",
- "color": "R"
}