openhealthcare/opal-iframe-api

Name: opal-iframe-api

Owner: Open Health Care

Description: An iframe api for an opal project that allows access to fields as long as they have the correct api key

Created: 2015-08-21 09:24:01.0

Updated: 2016-02-12 16:02:06.0

Pushed: 2016-06-28 16:22:00.0

Homepage:

Size: 33

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

This is iframeapi - an OPAL plugin.

This plugin allows you to embed records from an OPAL application in an external application.

For example, you could embed the most recent piece of Clinical Advice given about a patient, or a patient's allergy information in an Iframe (or similar).

Installation

Add to your INSTALLED_APPLICATIONS.

Run

$python manage.py migrate iframeapi
Usage

An API key can be combined the hospital number of a patient and an OPAL record name in a get request and get a plain text result.

Good requests look like:

/iframeapi/?hospitalNumber=XXXXXXXXXXXX&key=XXXXXXXXXXXXXXX&record=XXXXXXXXXX    

All models must subclass PatientSubrecord or EpisodeSubrecord and a template for the result needs to be put in iframe_templates with the model name in lowercase (examples included are iframe_templates/allergies, iframe_templates/antimicrobial).

Limiting to the latest entry

You may also limit the display to the latest entry by adding the latest parameter e.g.

/iframeapi/?hospitalNumber=XXXXXXXXXXXX&key=XXXXXXXXXXXXXXX&record=XXXXXXXXXX&latest=true

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.