COVID Recovery Corps integration design
In this document we’ll describe the integration and interaction between the systems that will be used to implement the first phase, with an eye toward evolving the system in the future.
Our external partner for this work is Columbia University Irving Medical Center (CUIMC) OHC. Their system is a part of the overall workflow we are supporting for this project. They have requested that we use HTTP Basic Authentication to authenticate their calls. We will need to create endpoints where we validate their credentials and perform some work. All the functionality exists in Bridge, it would just need to be orchestrated differently.
Questions for CUIMC: is there any rate-limiting? (They call us now in all cases, so this hasn’t been an issue.)
Workflow State
The Bridge Account object should be tagged with one (and only one) of the following data groups:
State | Description | Transitions to |
---|---|---|
<no state> | Accounts should be created with no state. The account exists, but is not consented to participate in the study. | enrolled |
enrolled | When the participant consents to the default consent, we add the | selected, declined |
declined | Researchers have decided this person should not be asked to have lab work done |
|
selected | Researchers have indicated this person should get lab work done. | tests_requested |
tests_requested | The worker process or API call to Bridge has created a lab order with the lab, which triggers a message from the lab to go schedule an appointment. | tests_scheduled |
tests_scheduled | CUIMC has verified that the participant has scheduled to have their lab work done. Save this information as a participant report (“appointment” at 1970-01-01) and update the participant to | tests_collected |
tests_cancelled | CUIMC has sent an appointment record with a status field of “cancelled.” (The other known state is “booked” for when an appointment has been scheduled). | Possibly back to tests_scheduled if user reschedules |
tests_collected | CUIMC has verified that the participant has had lab specimens collected, and they are currently being processed. Save this information as a participant report (“collection” at 1970-01-01) and update the participant to | tests_available |
tests_available | CUIMC has verified that tests results are available by submitting them to Bridge, where they have been saved as health data. Bridge will be able to show these results through the patient portal using access to health data raw data API being developed. We also update the participant to | tests_notified |
tests_available_type_unknown | CUIMC has sent us observation JSON, but it’s for a test of a type we don’t know and didn’t expect to receive. |
|
tests_notified | The UI can look at this state and adjust the UI to highlight test results, as this is one of the main benefits for participants (the test results). |
|
There’s a state_change_timestamp
attribute in each participant, indicating the last time that either Synapse or CUIMC have updated the participant record through the CRC specific endpoints. The state transitions occur through the following agents:
State | Agent & API |
---|---|
<no state> | The participant completes the consent, and the |
enrolled | The research team signs into a Synapse UI and reviews all the |
declined | <end state> |
selected | A script written by Megha periodically depends this in Synapse and calls to update the Bridge participant by calling the /v1/cuimc/participants/{userId}/laborders endpoint. This marks the Bridge account as Periodically, CUIMC polls the Bridge server to search for |
tests_requested | The user must then schedule for lab work. When this is completed, the CUIMC system will call back Bridge with an FHIR |
tests_cancelled | If the user has scheduled for lab work, and later cancels, we’ll get an updated FHIR |
tests_scheduled | The user goes to the lab to get specimens collected. CUIMC calls Bridge to notify us that the specimens have been collected and are being processed with a |
tests_collected | When the lab is done processing the specimens, CUIMC will send back an |
tests_available | This state ensures the participant will not be examined again by our worker. The UI can use this data group to highlight testing since it’s available and should be stored in the StudyParticipant |
Data Persistence
All the data being submitted for this project needs to be in Synapse, and it needs to be accessible to the participants and researchers. Normally research data is not accessible to the Bridge system. The issue with this is that the calls are not atomic... they can succeed in one call but fail in another, leaving the system in an inconsistent state.
Here is how I currently believe we're going to address this:
Enrollment survey answers. These are sent to the reports API until completed, and then sent to the health data API. This means the reports API data will be complete when the health data API succeeds, should be ok. Some of this data is also going to be saved on the participant record itself (if it's PHI).
Labs confirming prior covid infection. The user will upload this file through the uploads API, which Dwayne is adjusting so it will accept unencrypted, uncompressed files. He’s also going to introduce a new API for researchers to retrieve HealthDataRecords, including this file and surveys.
Wendy examining new consented participants. if 1 and 2 are done correctly, a UI can be created for Wendy’s team to review participants and to accept or reject them for further testings.
Test results from Columbia lab. I believe this result will be JSON and again they will be able to submit it via the /v3/uploads API. We believe the lab will send a message to users, telling them they can sign in to our portal to view the results.
So we will need the following the APIs:
upload JSON as exportable health data (already exists)
upload binary as health data (sorta exists--we need to add the flags for non-encrypted, non-zipped data)
participant API to retrieve health data by date range (already exists)
researcher API to retrieve health data by participant and date range (TODO)
participant API to retrieve the raw data of their own health data record (TODO)
researcher API to retrieve the raw data of any participant in their app (TODO)
worker API to update a participant (TODO, our worker could also be a researcher to avoid creating this)
We also need the following external integration endpoints to work with our partner at Columbia. These will take an API key or just credentials for a specific account and will not require prior authorization (ie. authorization will happen in the controller):
API to submit appointment information for a user that will move the state of the user to TESTS_SCHEDULED;
API to submit the fact that the labs have been collected, which moves the state of the user to TESTS_COLLECTED;
API to submit the tests results of the labs that submits the data to our health data API and moves the state of the user to TESTS_AVAILABLE.
Worker Process
Synapse has a client that is calling an endpoint to update Bridge records. CUIMC is using a normal Bridge account to sign in and access participant records.