Skip to content

Latest commit

 

History

History
80 lines (55 loc) · 3.05 KB

preliminary.md

File metadata and controls

80 lines (55 loc) · 3.05 KB
title subtitle
Preliminary Blood Pressure Prototype
Development: "Pre MVP"

Proof of Concept

The first instance of a JupyterHealth deployment is a proof-of-concept, or "pre PVM" product. We want to create something that demonstrates the overal architecture can work, but without using real patient data and without requiring access to existing institutional infrastructure.

(commonhealth)=

CommonHealth

(jupyterhub)=

JupyterHub

The pre MVP hub is deployed by 2i2c using their Managed JupyterHubs Service. The configuration for it is in the 2i2c infrastructure repository.

The image specifying the user environment is deployed from the jupyterhealth/singleuser-image repo and hosted at https://quay.io/repository/jupyterhealth/singleuser-premvp.

The user image is based on the jupyter/scipy-notebook image.

The user image also contains a jupyter_health package (not yet published as a package available elsewhere), which provides a JupyterHealthCHClient class, which loads credentials from the environment, so needs no arguments:

from jupyter_health import JupyterHealthCHClient

ch_client = JupyterHealthCHClient()

Registering new patients

New patients can be registered with deep links:

deep_link = ch_client.construct_authorization_request_deeplink(
    "patient-id",
    scope="OMHealthResource.HeartRate.Read OMHealthResource.BloodPressure.Read",
    expiration_seconds=2592000,
)
print(deep_link)

The resulting URL can be shared with patients to start uploading data to CommonHealth Cloud.

Fetching patient data

Once a patient is enrolled and has uploaded some data, patient data can be fetched using the patient id/name used when creating the deep link:

records = ch_client.fetch_data("patient-id")

Each record is a ResourceHolder instance, where json_content contains the actual data. json_content has a header with metadata identifying the schema, and a body containing the measurement itself. To extract blood pressure measurements:

bp_readings = [
    record.json_content["body"]
    for record in records
    if record.resource_type == "BLOOD_PRESSURE"
]

Which will select the data according to the openmhealth blood pressure schema. These readings can then be passed to a plotting utility like this one.

Demo dashboards

The jupyterhealth/demos repo contains some example notebooks and voilá dashboards, which can be cloned and launched via nbgitpuller links in the readme. Anyone with access to the JupyterHealth JupyterHub should be able to run these.