Skip to content

Getting Started with popHealth API

petercyli edited this page Jul 18, 2017 · 23 revisions

Setting Up PopHealth For API Access

From popHealth configuration file (located in popHealth/config/popHealth.yml), set the “enable_csrf_for_apis” parameter to false

enable_csrf_for_apis: false

Save the file and restart apache server and pophealth_delayed_worker process. The following examples use Postman application to access the popHealth REST interface.

How to Pass the Credentials to the API?

popHealth uses “Basic Auth”. Every service call requires user/password for authentication. Example: Retrieve a list of popHealth users - GET /api/admin/users. Note the setting for “Basic Auth” and the response in JSON. API Authentication

How to import a single patient XML file (Cat I or C-CDA) to a practice

Use POST /api/patients. Note that the setting for Authorization doesn’t change. The example below shows the “Body” setup for the Post call and the response indicating patient file imported. Load Patient File

How to import a (Cat I or C-CDA) patient zip file to a practice

Use POST /api/admin/patients. The example below shows the “Body” setup for the Post call and the response indicating patient file has been uploaded. Load Zip File

How to Start a Measure Calculation

Use POST /api/queries. The example below shows the “Body” setup for the Post call. Note that we used the “raw” with JSON(application/json) format to transmit the parameters.

  • measure_id - hqmf_id of the measure. You can find it from the following page in popHealth application - http://pophealth-demo.osehra.org/#admin/measures
  • effective_date - the end date of the reporting period. Use the epoch converter - https://www.epochconverter.com/ to convert dates from 12-31-2015
  • effective_start_date – the start date of the reporting period, i.e., 1-1-2015
  • providers – object id of the provider for “Practice OSEHRA”. This value is obtained from the Mongodb using Robomongo viewer
Clone this wiki locally