This project contains the dockerized setup for the PLIR project Proof Of Concept. see PLIR archtecture
Ensure you have Docker and Docker compose installed locally. See Docker Installation Instructions for your environment. If running on Linux, check https://docs.docker.com/compose/install/ to install docker compose.
To run the project , follow the instructions below .
-
Clone the repository locally
git clone https://github.com/openmrs/openmrs-plir-dockerized-setup.git
-
Move to the project root directory and spin up the pre-configured OpenMRS ,OpenHIM ,Hapi-Fhir and the streaming-binlog pipeline instances .
./run.sh
-
You should be able to acces the OpenMRS ,OpenHIM and Hapi-Fhir instances at the following urls
Instance | URL | credentials (user : password) |
---|---|---|
OpenMRS | http://localhost:8080/openmrs | admin : Admin123 |
OpenHIM | http://localhost:9000 | root@openhim.org : openhim-password |
Hapi FHir | http://localhost:8090 | hapi : hapi123 |
Note:
-
The OpenMRS Instance is pre-loaded with CIEL and a sample form (HIV_form) to collect TX_PVLS, specific data and also TX_CURR data
-
The above script also loads the necesary TX_PVLS,TX_CURR Measure and Library Resources into the Hapi FHir . see the Resources under the
resources
folder. -
The Openhim instance is pre-configured with the necesary meta-data
Wait for the plir-streaming-pipeline container to start running before adding any data into OpenMRS. The running Pipeline will then listen to any data changes added in to OpenMRS and route them to the FHIR server through OpenHIM.
- Invoke the collect-data FHIR Operation using the GET request below to generate the relevant Dataset for
TX_PVLS:
GET: http://localhost:8090/fhir/Measure/TX-PVLS/$collect-data?periodStart=<date>&periodEnd=<date>
TX_CURR:
GET: http://localhost:8090/fhir/Measure/TX-CURR/$collect-data?periodStart=<date>&periodEnd=<date>
- Invoke the evaluate-measure FHIR Operation using the GET request below for the indicator calculation based on CQL evaluation
TX_PVLS:
GET: http://localhost:8090/fhir/Measure/TX-PVLS/$evaluate-measure?periodStart=<date>&periodEnd=<date>
TX_CURR:
GET: http://localhost:8090/fhir/Measure/TX-CURR/$evaluate-measure?periodStart=<date>&periodEnd=<date>
Note : substitute
<date>
in the GET request with your actual date parameter .
6.You can use the plir-widget to easily query and visualise the Measure report generated from the HAPI-FHIR server .see widget source code under plir-widget/widget-source
-
install the http-server . see inginix (proxy-server) config under
plir-widget/config/nginx.conf
. -
To run the widget , run the command below from the root directory
./run-widget.sh
-
you should be able to access the widget at
http://localhost:7000/
.
Procede to select the measure TX-PVLS,TX_CURR , select the start date and generate the report using the widget
-
To remove and clean out all created containers and volumes, run
./stop.sh
In case changes have been made to the Library cql logic at resources/tx_pvls_cql.txt
orresources/tx_curr_cql.txt
, the TX_PVLS,TX_CURR Library resources at resources/tx_pvls-library.json
& resources/tx_curr-library.json
can be auto re-generated .
-
install the jq library
-
run the command below from the root directory
./scripts/regenerate_tx_pvls-library.sh or ./scripts/regenerate_tx_curr-library.sh
The above script encodes the cql logic into Base64 format and rebuilds the TX_PVLS/TX_CURR Library
You can run the tests in the CI enviroment .see PLIR CI Automated Testing
To set up a local Testing enviroment , Follow the steps below .
Clone the hie-automation-tests framework that Supports Testing PLIR workflow.
git clone https://github.com/openmrs/hie-automation-tests.git
see more details
- Python version >= 3.7
- Behave version >= 1.2
- Debezium-FHIR-Analytics component
- OpenMRS
- OpenHIM
- HAPI-FHIR
Update the Configuration in the config.json file located under the features/config
folder . Only OpenMRS , OpenHIM and HapiFHIR are required
NOTE :The deafult configuration are mapped to the default configuration in the dockerized PLIR setup
See sample observation data Posted to OpenMRS under features/data
ie obs1.json ,obs2.json ,obs3.json
.In case any values are adjusted in the above sample data, adjust the expected TX_PVLS score (rounded off to two decimal places) ie TX_PVLS-SCORE in the config file
- The Test will work best before you add any data to OpenMRS
Execute the test with the command below, under the root directory,but first ensure the PLIR pipeline is up and running.
behave --no-logcapture --include ./features/PLIR
The tests will
- Post Obs data into OpenMRS
- Track the transactions in OpenHIM
- Check whether the correct TX_PVLS indicator measureScore was calculated in HAPI FHIR
- Check whether the correct TX_CURR indicator measureScore was calculated in HAPI FHIR
- Hapi FHir for OpenMRS PLIR https://github.com/openmrs/openmrs-contrib-plm-fhir-server
- OpenMRS FHIR Analytics tool https://github.com/GoogleCloudPlatform/openmrs-fhir-analytics