Skip to content

Instantly share code, notes, and snippets.

@benoror
Last active June 28, 2017 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benoror/053bd62cdf8867912d1ed05cded2a71b to your computer and use it in GitHub Desktop.
Save benoror/053bd62cdf8867912d1ed05cded2a71b to your computer and use it in GitHub Desktop.

Tech Spec: Cumulus Alpha 0.1

Summary

As explained in the original purpose doc, Cumulus aims to provide a centralized way for sharing health records in a way that a diversity of systems (a.k.a. consumers) can pull & push patient data in an organized way, thus keeping the health records updated and relevant throughout different healthcare providers and the patient itself.

TL;DR; Digital health information should follow the patient throughout modern healthcare providers, and not the other way around

Technology / Components Architecture

  • Persistance: Central repository
    • NoSQL (mainly) data persistance for flexibility & max compatibility w/ other backend / client consumers
  • API Server:
    • Data Exchange: REST/GraphQL service
    • Auth: OAuth 2.0 (or similar)
  • Transformation Layer
    • Can be on the API or Client-side (ex. Ember-Data adapter)
    • To expose/accept data in standard formats:
+--------+   +--------+   +--------+
|        |   |        |   |        |
| Client +-->| Server |   | Client |
|        |   |        |   |        |
+--------+   +-----+--+   +--+-----+
                 ^ |         |  ^
                 | |         |  |
                 | v         v  |
.---+------------+--------------+-----.
| C |      Transformation Layer       |
| U +---------------------------------+
| M |                                 |
| U |          API Server             |
| L |                                 |
| U +---------------------------------+
| S |           NoSQL DB              |
'---+---------------------------------'

*Note: The aforementioned components, specially at the backend, doesn't have be a monolithic bundle at all, as they can can be decoupled microservices deployed in a distributed way. Examples of decoupled/distributed architectures:


Database

Document-based JSON (NoSQL) databases feel a natural fit for the health record use-case:

These documents are self-describing, hierarchical tree data structures which can consist of maps, collections, and scalar values. The documents stored are similar to each other but do not have to be exactly the same.

Alternatively Column-family databases might also be useful, regarding performance and data-sharding:

Column families are groups of related data that is often accessed together

For a Cumulus prototype, a widely-use, general-purpose document-based databas would be better suited, as stated:

  • Document databases are generally useful for content management systems, blogging platforms, web analytics, real-time analytics, ecommerce-applications. We would avoid using document databases for systems that need complex transactions spanning multiple operations or queries against varying aggregate structures.
  • Column family databases are generally useful for content management systems, blogging platforms, maintaining counters, expiring usage, heavy write volume such as log aggregation. We would avoid using column family databases for systems that are in early development, changing query patterns.

Other sources:

Related: https://github.com/ecaresoft/ecs-meta/pull/32

Options


API Stack

Client


MVP Scenarios

Standards

Initially a simple format based on CCR standard could be implemented, containing the main 6 sections (see @luissifu comment below):

  1. Header
  2. Patient Identifying Information
  3. Patient Financial and Insurance Information
  4. Health Status of the Patient
  5. Care Documentation
  6. Care Plan Recommendation

In later versions, full CCR-compatible records should be available, as it is the basis for compatibility with other standards:

                     ____________
   .-----------.     \           \....................... (CCR-compatible systems)
  /     CCR     \     \   XML     \     __________
 (               )---->) Transf.   )    \   XSLT  \
  \    {JSON}   /     /   Layer   /---->/  Layer  /...... (CCD/HL7 FHIR CDA systems)
   '-----------'     /___________/     /_________/
         \
          ............................................... Other systems (Nimbo X, ...)
          
FHIR

FHIR® – Fast Healthcare Interoperability Resources (hl7.org/fhir) – is a next generation standards framework created by HL7. FHIR combines the best features of HL7's v2 , HL7 v3 and CDA product lines while leveraging the latest web standards and applying a tight focus on implementability.

FHIR solutions are built from a set of modular components called "Resources". These resources can easily be assembled into working systems that solve real world clinical and administrative problems at a fraction of the price of existing alternatives. FHIR is suitable for use in a wide variety of contexts – mobile phone apps, cloud communications, EHR-based data sharing, server communication in large institutional healthcare providers, and much more.

https://www.hl7.org/fhir/summary.html

Patient Idetification

For the MVP, patient id would be simple, matching the SSN, CURP or similar. Later on more complex matching can be implemented.

Push: Insert / Update a record

An UPSERT operation should be done when Creating or Updating a record, using it's identityNumber as primary key.

Pull

A revision number should be included in every record's header, being a serial number, or even better a hash fingerprint that uniquiley represent a changeset.

A polling mechanism should be available so the consumer can figure out if it has the latest revision of the record.

+------+                       +-----+
|      | Patient 1, Revision 3 |     |
|  N   +---------------------->|  C  |
|  i   |                       |  u  |
|  m   |                       |  m  |
|  b   |   OK, latest rev: 3   |  u  |
|  o   |<----------------------|  l  |
|      |                       |  u  |
|  X   |                       |  s  |
|      |                       |     |
+------+                       +-----+

--------------------------------------

+------+                       +-----+
|      | Patient 1, Revision 3 |     |
|  N   +---------------------->|  C  |
|  i   |                       |  u  |
|  b   |  {NEW DATA} (Rev: 4)  |  u  |
|  o   |<----------------------|  l  |
|  o   |                       |  l  |
|      |                       |  u  |
|  X   |                       |  s  |
+------+                       +-----+

Changes logging

For the MVP this wouldn't be in the scope. Nevertheless it's important to consider a robust enough data model that can handle edit history.

Think of it as an intermediary point between Google Docs & Git.

Data syncing

Ideally data syncing between Cumulus and consumers should be automatic, with notifications for the changes made since last visit (ex. new medical conditions, procedures, etc).

See:

For the MVP this can be triggered manually for PoC purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment