Sandbox Testing for Monitoring

Leverage our Sandbox environment to develop & test Monitoring workflows

πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦ Create Patients & Subscriptions in Sandbox

As in Production, in order to set up and test Monitoring in Sandbox, you will first need to create patients and subscriptions for your patients in Sandbox, via the following steps:

1. Generate a JSON web token using Authentication.

2. Create patients

Submit demographics via the Patients API and store the Particle Patient ID returned for each patient.

πŸ“˜

There are specific test patients and organizations available in Sandbox to test Referral Management workflows. See details below.

POST /api/v1/patients

Sample Request


{
    "address_city": "Boston",
    "address_lines": [
        "703 Ankunding Trail Unit 45"
    ],
    "address_state": "MA",
    "date_of_birth": "1970-12-26",
    "email": "[email protected]",
    "family_name": "Valadez",
    "gender": "Female",
    "given_name": "Elvira",
    "npi": "1234",
    "postal_code": "02215",
    "purpose_of_use": "TREATMENT",
    "ssn": "123-45-6789",
    "telephone": "1-234-567-8910",
    "patient_id": "test-external-patient-id"
}

Sample Response

{
    "given_name": "Elvira",
    "family_name": "Valadez",
    "date_of_birth": "1970-12-26",
    "gender": "FEMALE",
    "ssn": "123-45-6789",
    "email": "[email protected]",
    "address_lines": [
        "703 Ankunding Trail Unit 45"
    ],
    "address_state": "MA",
    "address_city": "Boston",
    "postal_code": "02215",
    "telephone": "(234) 567-8910",
    "patient_id": "test-external-patient-id",
    "particle_patient_id": "d939196d-0c80-4e82-b0e1-19f9ee271085",
    "consent": null
}

3. (For Testing Referral Management Only) Register Referral Organizations

Register the Referral Organization supported in Sandbox, to be able to configure monitoring for patient referrals to the organization. See details on test organizations below.

POST /api/v1/referrals/organizations

Sample Request

{  
    "organizations": [  
        {  
            "oid": "2.16.840.1.113883.3.8391.5.710576"  
        }  
    ]  
}

4. Subscribe patients to Monitoring notifications

Subscribe your patient(s) to Monitoring notifications via the Subscriptions API. Refer to guide for detailed setup steps.

  1. Cohort of Patients:POST /api/v1/patients/subscriptions
  2. Individual Patient: POST /api/patients/{particle_patient_id}/subscriptions

Sample Request - Referral Alert Notifications

{
  "subscriptions": [
    {
      "type": "REFERRAL_ALERT",
      "particle_patient_id": "d939196d-0c80-4e82-b0e1-19f9ee271085",
      "referred_to_oid": "2.16.840.1.113883.3.8391.5.710576",
    }
  ]
}

Sample Response

{
  "subscriptions": [
    {
      "id": "39774a2f-b6fb-46a0-88c9-30843a5127b7",
      "type": "REFERRAL_ALERT",
      "state": "SUBSCRIBED"
    }
  ]
}

Test Patients & Organizations for Referral Management

Test Patients

You can subscribe a full cohort of any patients that you have created in Sandbox to Referral Alerts from the Referral Organization listed below.

It is important to note that you will only be able to test out Referral Alert notifications and data delta retrieval workflows for the synthetic patient Elvira Valdez (see patient details here), as this is the only patient for whom we currently have synthetic data to support Referral Management workflows in Sandbox.

πŸ“˜

If you want to test out Referral Management workflows, you will need to create and subscribe the patient Elvira Valdez, with the patient details here, in order to do so.

Test Organizations

In addition, if you are testing out Referral Management, you will need to specify the referred_to_oid for the Referral Organization for each patient that you subscribe to Referral Alerts. There is one Referral Organization currently supported in Sandbox. You will need to pass the referred_to_oid for this Referral Organization when you subscribe any patient(s) to Referral Alerts:

Referral Organizationreferred_to_oidAddressNPI
Rochester Hospital2.16.840.1.113883.3.8391.5.71057611 Main St
Rochester, MA, 02770
1234567890

See guide for more details on how to configure Referral Management.

βš™οΈ Configure Callback URLs for Test Notifications

Configure the callback URL(s) that you would like us to send proactive querying, network alert, referral alert, & ADT notifications to.

➑️

Note: Unlike in the production environment, we do not need to pre-register the callback URL for our customers in order for them to start receiving notifications. You are free to use any callback URL you would like.

πŸ”” Trigger Test Notifications & Retrieve Data in Sandbox

Referral Management

  1. After you have created a patient, subscribed to test notifications request a Referral Alert notification.

POST /api/v1/patients/{particle_patient_id}/subscriptions/trigger-sandbox-workflow\

Request Body:

{
    "workflow": "REFERRAL_ALERT", // valid: "Referral Alert"
    "callback_url": "http://test-webhook-url",// callback url to receive the test notif
    "display_name": "Test Referral Alert 1" // display name for the webhook
}
  1. You will receive a notification at the webhook you specified. This notification will contain the Particle Patient ID, Referral Alert details, and query id.

Sample - Referral Alert Notification

{
  "specversion":"1.0",
  "type":"com.particlehealth.api.v2.referralalert",
  "source": "api/notifications",
  "id": "f834539f-a839-490b-80f9-b441cb9e435d",
  "time":"2023-05-15T12:00:14.694292853Z",
  "datacontenttype":"application/json",
  "data":{
    "network_organization": {
      "name": "Rochester Hospital",
      "oid": "2.16.840.1.113883.3.8391.5.710576"
    },
    "particle_patient_id": "73630f6a-d8e3-4295-bf70-7214d68b4ed7",
    "referral_id": "df76019c-2fd9-42da-98a7-359b4dc66caf",
    "referral_status": "COMPLETE",
    "resources": [
      {
        "resource_ids": [
          "Encounter/e68f30e9-8342-4fb7-9bcb-6cab47d5c6b0"
        ]
      }
    ]
  }
  1. Retrieve the sample data delta for Elvira Valdez using the Deltas API:

FHIR: GET /R4/patient/{particle_patient_id}/$everything
FLAT: /deltas/flat/{particle_patient_id}

In addition to retrieving the full patient history or data delta in FHIR or FLAT, you can also retrieve the individual referral encounter, by passing the resource_ids provided in the notifications.

FHIR: GET R4/Encounter/e68f30e9-8342-4fb7-9bcb-6cab47d5c6b0

πŸ“˜

We currently support triggering 5 Referral Alerts, and retrieving 5 associated deltas/files/encounters for the patient Elvira Valdez in Sandbox. After you have triggered 5 Referral Alerts, the data will automatically reset, if you want to run further testing with the same patient data.

ADTs

  1. After you have subscribed to test notifications and configured the appropriate call back URLs, request an ADT notification using the Register HL7v2 API.
    POST /api/v1/patients/{particle_patient_id}/subscriptions/trigger-sandbox-workflow

Request Body:

{
    "workflow": "ADT", // valid: ADT
    "event_type": "A01", // valid: A01, A02, A03, A04, A08
    "callback_url": "http://test-webhook-url",// callback url to receive the test notif
    "display_name": "Test ADT Notification 1" // display name for the webhook
}
  1. You will receive a notification at the webhook you specified. This notification will contain the Patient ID and a message ID.
  2. Retrieve the sample ADT message using theΒ HL7v2 API.
    GET /hl7v2/{message_id}

Sample ADT messages are customized based on the patient and ADT event type specified.