Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
- updates for SMART v0.5
- updates for removed calls, fixes chb#32
  • Loading branch information
Travers Franckle committed Dec 31, 2012
1 parent eb44974 commit 5b2cfc9
Show file tree
Hide file tree
Showing 26 changed files with 396 additions and 1,039 deletions.
703 changes: 114 additions & 589 deletions doc/sphinx/autogen/api-skeleton.py

Large diffs are not rendered by default.

111 changes: 47 additions & 64 deletions doc/sphinx/source/api.rst → doc/sphinx/source/api-overview.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Indivo API
==========
Indivo API Overview
===================

The Indivo API provides an interface for Personal Health Applications to extend the functionality of the
Indivo PCHR. The Indivo API abides by the REST design pattern: it is stateless, re-uses existing HTTP
Expand Down Expand Up @@ -72,7 +72,7 @@ When a list of results are returned, the URL ends in a ``/`` and the HTTP method
REST design. In that case, Indivo X supports a generic query string that determines paging and ordering of
the results::

?offset={offset}&limit={limit}&order_by={order_by}&status={document_status}&modified_since={modified_since}
?offset={offset}&limit={limit}&order_by={order_by}&status={document_status}

* ``offset`` indicates which item number to start with, e.g. when getting a second batch of items.

Expand All @@ -86,15 +86,13 @@ the results::
* ``status`` can be used where applicable. It pertains to the status of documents and can currently be set to
one of three options: 'void', 'archived' or 'active'

* ``modified_since`` allows an application to look at items that have been modified since a given timestamp,
so that incremental downloads may be possible.

Querying Results
^^^^^^^^^^^^^^^^

As of the Beta3 release, calls that implement the basic paging operations above may also implement a more
powerful :doc:`query interface <query-api>`, also represented in the query string. In these cases (currently
all of the minimal medical reports and the auditing calls), the following values may occur in the query string::
all of the :doc:`Generic Reports <generic-reports>` and the :ref:`auditing calls <audit-query-fields>`), the
following values may occur in the query string::

?offset={offset}&limit={limit}&order_by={order_by}&status={document_status}

Expand Down Expand Up @@ -482,73 +480,71 @@ Record-Application-specific storage calls are all 3-legged oAuth calls.
Delete a record-application-specific document. Since these documents do not
contain medical data, deleting them is acceptable.

.. _processed-reports:

Processed Medical Reports
-------------------------

Indivo processes documents into medical reports. Each report can be altered by the
basic paging mechanism or the more complex query interface described above. Over
time, new reports may be introduced. For now, we define these as the minimal set
of reports. Fields supported by individual reports for the querying interface may
be found :ref:`here <valid-query-fields>`. Response formats correspond to the
:doc:`schemas/reporting-schema`, and individual reports fit their individual
datatype's schema (see :ref:`medical-schemas`). If a report is accessed via a
carenet, only documents that are shared into the carenet will appear in the
results.

.. glossary::

:http:get:`/records/{RECORD_ID}/reports/minimal/equipment/`
:http:get:`/carenets/{CARENET_ID}/reports/minimal/equipment/`
List equipment for a given record.
.. _reporting-APIs:

:http:get:`/records/{RECORD_ID}/reports/minimal/labs/`
:http:get:`/carenets/{CARENET_ID}/reports/minimal/labs/`
List lab results for a given record.

:http:get:`/records/{RECORD_ID}/reports/minimal/measurements/{LAB_CODE}/`
:http:get:`/carenets/{CARENET_ID}/reports/minimal/measurements/{LAB_CODE}/`
List measurements for a given record.
Reporting APIs
--------------

:http:get:`/records/{RECORD_ID}/reports/minimal/procedures/`
:http:get:`/carenets/{CARENET_ID}/reports/minimal/procedures/`
List procedures for a given record.
Indivo Currently supports two main APIs for reporting over :doc:`Data Models <data-models/index>`

:http:get:`/records/{RECORD_ID}/reports/minimal/simple-clinical-notes/`
:http:get:`/carenets/{CARENET_ID}/reports/minimal/simple-clinical-notes/`
List clinical notes for a given record.
.. _smart-reporting-api:

SMART API Calls
---------------
SMART API Calls over Data Models
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

As Indivo now supports the `SMART API <http://dev.smartplatforms.org/>`_, the following
calls are now available:
calls are now available for reporting over the various SMART Data Models

.. glossary::

:http:get:`/records/{RECORD_ID}/{MODEL_NAME}/`
Get a SMART RDF list of a patient's medical data of type ``MODEL_NAME``. Available data models are:

* ``allergies``
* ``clinical_notes``
* ``encounters``
* ``fulfillments``
* ``immunizations``
* ``lab_panels``
* ``lab_results``
* ``medications``
* ``problems``
* ``vital_signs``
* ``procedures``
* ``social_history``
* ``vital_sign_sets``


Generic Reports
^^^^^^^^^^^^^^^

Indivo provides the ability to run 'generic' reports over all :doc:`data models <data-models/index>`.
These reports support the :doc:`API Query Interface <query-api>`, and provide an
out of the box solution for reporting over core and contributed data models,
with the possibility for :ref:`customization <response_format_customization>`.

.. glossary::

:http:get:`/records/{RECORD_ID}/reports/{DATA_MODEL}/`
:http:get:`/carenets/{CARENET_ID}/reports/{DATA_MODEL}/`

See :doc:`Generic Reports <generic-reports>` for more information


SMART API Calls
---------------

In addition to the :ref:`SMART calls over specific Data Models <smart-reporting-api>`,
Indivo also supports the following SMART Calls:

.. glossary::

:http:get:`/apps/{APP_ID}/manifest`
:http:get:`/apps/manifests/`
Get SMART-style JSON manifests for one or all apps registered with this
instance of Indivo.

:http:get:`/ontology`
Get the ontology used by a SMART container

:http:get:`/capabilities/`
Get the SMART capabilities for this instance of Indivo.
:http:get:`/manifest`
Get the SMART container manifest describing its properties and capabilities

:http:get:`/accounts/{ACCOUNT_EMAIL}/apps/{PHA_EMAIL}/preferences`
Get account preferences for a specific application.
Expand All @@ -558,21 +554,8 @@ calls are now available:

:http:delete:`/accounts/{ACCOUNT_EMAIL}/apps/{PHA_EMAIL}/preferences`
Remove all account preferences for a specific application.

Generic Reports
---------------

Indivo provides the ability to run 'generic' reports over all :doc:`data models <data-models/index>`.
These reports support the :doc:`API Query Interface <query-api>`, and provide an
out of the box solution for reporting over core and contributed data models,
with the possibility for :ref:`customization <response_format_customization>`.

.. glossary::

:http:get:`/records/{RECORD_ID}/reports/{DATA_MODEL}/`
:http:get:`/carenets/{CARENET_ID}/reports/{DATA_MODEL}/`
List a patient's medical data.



Coding Systems
--------------

Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

# Mock packages that we don't need so that code imports work
# on systems without the packages
mocks = ['markdown', 'markdown.preprocessors.Preprocessor', 'mardown.Extension', 'rdflib']
mocks = ['markdown', 'markdown.preprocessors.Preprocessor', 'mardown.Extension', 'rdflib', 'rdflib.collection']
class Mock(object):
def __init__(self, *args, **kwargs):
pass
Expand Down
28 changes: 28 additions & 0 deletions doc/sphinx/source/data-models/clinical_note.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Indivo Data Model: ClinicalNote
=======================================

Model Definition
----------------

As a Django Model Class:

.. include:: /../../../indivo/data_models/core/clinical_note/model.py
:literal:

Examples
--------

As :ref:`SDMJ <sdmj>`:

.. include:: /../../../indivo/data_models/core/clinical_note/example.sdmj
:literal:

As :ref:`SDMX <sdmx>`:

.. include:: /../../../indivo/data_models/core/clinical_note/example.sdmx
:literal:

As a :term:`Fact object <fact>`:

.. include:: /../../../indivo/data_models/core/clinical_note/example.py
:literal:
18 changes: 18 additions & 0 deletions doc/sphinx/source/data-models/encounter.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Indivo Data Model: Encounter
=======================================

Model Definition
----------------

As a Django Model Class:

.. include:: /../../../indivo/data_models/core/encounter/model.py
:literal:

Examples
--------

As :ref:`SDMX <sdmx>`:

.. include:: /../../../indivo/data_models/core/encounter/example.sdmx
:literal:
33 changes: 0 additions & 33 deletions doc/sphinx/source/data-models/equipment.rst

This file was deleted.

Loading

0 comments on commit 5b2cfc9

Please sign in to comment.