Giter Site home page Giter Site logo

gitcliff / hie-automation-tests Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openmrs/hie-automation-tests

0.0 0.0 0.0 1.05 MB

HIE Automation testing framework - OpenMRS, OpenHIM, OpenSHR, HAPI-FHIR, OpenEMPI

License: Apache License 2.0

Gherkin 4.49% Python 95.51%

hie-automation-tests's Introduction

HIE Automation Testing Framework

HIE Automation Testing framework was built using Python and Behave to support automation testing of different HIE systems. Currently, this project automates the testing of the OpenMRS data load and Case Based Reporting Module (CBR) workflows. Data is posted to OpenMRS and the state of the data is tested in different HIE systems (OpenMRS, OpenHIM, OpenSHR, OpenEMPI, and HAPI-FHIR)

Getting Started

Currently, the testing framework contains 3 automation tests, one tests the bulk data load to OpenMRS and other 2 tests OpenMRS Case based Reporting module’s workflows.

Testing data load into OpenMRS

OpenMRS_BulkHIVDataLoad, A simple test that tests the bulk data load into an instance of OpenMRS and provides the user with the stats (Number of patients, encounters and observations records loaded).

Assumptions

User is familiarity with OpenMRS, Python, and BDD framework Behave is assumed. Familiarity with HIE components is recommended.

Prerequisites

OpenMRS_BulkHIVDataLoad needs the following software -

  • Python version >= 3.7
  • Behave version >= 1.2
  • OpenMRS Platform version >= 2.2

Configuration

Update the config.json located under the config folder. Only 2 config elements (“datafilename” and “openmrsInstances”) are needed for this test. The other elements in the config file can be there or can be removed. They are optional. The value of datafilename needs to be “simulatordataset-large.json” and openmrsInstances needs to be configured with at least one OpenMRS instance information.

  • id : A unique value, gets tied to the “server” value in the dataset files located under data folder. If you add or modify this value, make sure the datasets are also updated.
  • instanceName : Can be any name, it’s for tester’s clarity.
  • baseUrl : Replace server and port with OpenMRS instance info
  • username : Username that can access the services of the above instance
  • password : Password of the above user

Executing the test

You can execute the test with the below statement.
behave --no-logcapture --include ./features/OpenMRS_BulkHIVDataLoad

Test Result : After the test executes, the user will see the stats being printed on the console.

Additionally, the user can query the Patient, Encounter and Obs tables to see the data posted.

Testing CBR with OpenMRS, OpenHIM, OpenEMPI and HAPI-FHIR

Two tests (CBR_HIVCareContinuum and CBR_Multi_location_HIVCareContinuumSteps) were developed to test CBR (Case Based Reporting) workflow that uses HAPI-FHIR as shared health record as repository.

Assumptions

User is familiarity with OpenMRS, OpenMRS Case Based Reporting (CBR) Module, Python, and BDD framework Behave is assumed. Familiarity with HIE components is recommended.

Prerequisites

Both CBR_HIVCareContinuum and CBR_Multi_location_HIVCareContinuum tests needs the following software

  • Python version >= 3.7
  • Python version >= 3.7 * Behave version >= 1.2
  • OpenMRS Platform version >= 2.2
  • OpenMRS Module - Case Based Module version >= 2.0 (Not yet released)
  • OpenMRS Module IDGen version >= 4.7
  • OpenEMPI platform >= 3.5.0c
  • OpenHIM platform >= 1.13
  • OpenHIM FHIR-Mediator >= Latest (Not yet released) HAPIFHIR instance >= 4.2.0

Note: CBR module must be configured (OpenMRS Home -> Case Reports ->Configure) to use Case Report Format as HL7 FHIR

Configuration

Update the config.json located under the config folder. All elements except OpenSHR is required for this test.

  • openmrsInstances needs to be configured with at least one OpenMRS instance.
  • id : A unique value, gets tied to the “server” value in the dataset files located under data folder. If you add or modify this value, make sure the datasets are also updated.
  • instanceName : Can be any name, it’s for tester’s clarity.
  • baseUrl : Replace server and port with OpenMRS instance info
  • username : Username that can access the services of the above instance
  • password : Password of the above user
  • openHIM : configuration details for OpenHIM core
  • baseUrl : replace server and port with OpenHIM core instance info
  • username : username that can access the above instance
  • password : password of the above user
  • openEMPI : configuration details for OpenEMPI rest services
  • baseUrl : replace server and port with OpenEMPI rest services info
  • username : username that can access the rest services
  • password : password of the above user
  • HAPI-FHIR : configuration details of hapi-fhir instance
  • baseUrl : replace server and port with hapi-fhir instance
  • username : username that can access the services of the above instance
  • password : password of the above user

Executing the test

CBR_HIVCareContinuum

This test tests the entire workflow of Case Based Reporting module. Based on the order of the events (Obs) specified on the Gherkin file, events (Obs) are posted to OpenMRS. For each event posted, the test confirms that -

  1. A Case report is created in OpenMRS
  2. Transaction is sent OpenHIM
  3. Patient Record is created or exists in OpenEMPI
  4. The case report gets stored in HAPI-FHIR
Additional Configuration : Before you execute this test, please update config.json, set dataFilename value as simulator-dataset-small.json

You can execute the test with the below statement.

behave --no-logcapture --include ./features/CBR_HIVCareContinuum  

CBR_Multi_location_HIVCareContinuum

This test also tests the entire workflow of Case Based Reporting module. But instead of posting data based on event as the previous test CBR_HIVCareContinuumSteps does, this test reads the data file, posts Patient records into multiple OpenMRS instances and posts all sentinel events sorted by date to OpenMRS instances. For each posted sentinel event, the test confirms that

  1. A Case report is created in the OpenMRS instance the event was posted to. 2. Transaction is sent OpenHIM
  2. Patient Record is created or exists in OpenEMPI
  3. The case report gets stored in HAPI-FHIR or OpenSHR (based on the configuration in CBR module)
Additional Configuration: Before you execute this test, please update config.json, set dataFilename value as simulator-dataset-multiple-instances.json. Also, you need at least 2 OpenMRS instances running for this test.

You can execute the test with the below statement.
behave --no-logcapture --include ./features/CBR_Multi_location_HIVCareContinuum

Testing CBR with OpenMRS, OpenHIM, OpenEMPI and OpenHSR

The two tests (CBR_HIVCareContinuum and CBR_Multi_location_HIVCareContinuumSteps) discussed earlier can also be used to test CBR (Case Based Reporting) workflow that uses OpenSHR as shared health repository .

Assumptions

User is familiarity with OpenMRS, OpenMRS Case Based Reporting (CBR) Module, Python, and BDD framework Behave is assumed. Familiarity with HIE components is recommended.

Prerequisites

CBR_HIVCareContinuum and CBR_Multi_location_HIVCareContinuumSteps needs the following software

  • Python version >= 3.7
  • Behave version >= 1.2
  • OpenMRS Platform version >= 2.2
  • OpenMRS Module - Case Based Module version >= 2.0 (Not yet released)
  • OpenMRS Module IDGen version >= 4.7
    OpenEMPI platform >= 3.5.0c
  • OpenHIM platform >= 1.13
  • OpenHIM XDS-Mediator >= Latest (https://github.com/jembi/openhim-mediator-xds)
    OpenMRS instance with OpenSHR >= Latest (https://github.com/jembi/openshr)

Note: CBR module must be configured (OpenMRS Home -> Case Reports ->Configure) to use Case Report Format as HL7 CDA

Configuration

Update the config.json located under the config folder. All elements except HAPI-FHIR is needed for this test.

  • openmrsInstances needs to be configured with at least one OpenMRS instance.
  • id : A unique value, gets tied to the “server” value in the dataset files located under data folder. If you add or modify this value, make sure the datasets are also updated.
  • instanceName : Can be any name, it’s for tester’s clarity.
  • baseUrl : Replace server and port with OpenMRS instance info
  • username : Username that can access the services of the above instance
  • password : Password of the above user
  • openHIM : configuration details for OpenHIM core
  • baseUrl : replace server and port with OpenHIM core instance info
  • username : username that can access the above instance
  • password : password of the above user
  • openEMPI : configuration details for OpenEMPI rest services
  • baseUrl : replace server and port with OpenEMPI rest services info
  • username : username that can access the rest services
  • password : password of the above user
  • openSHR : configuration details for OpenSHR instance
  • baseUrl : replace server and port with OpenSHR instance
  • username : username that can access the services
  • password : password of the above user

Executing the test

CBR_HIVCareContinuum

Additional Configuration : Before you execute this test, please update config.json, set dataFilename value as simulator-dataset-small.json

You can execute the test with the below statement.

behave --no-logcapture --include ./features/CBR_HIVCareContinuum  

CBR_Multi_location_HIVCareContinuum

Additional Configuration: Before you execute this test, please update config.json, set dataFilename value as simulator-dataset-multiple-instances.json. Also, you need at least 2 OpenMRS instances running for this test.

You can execute the test with the below statement.

behave --no-logcapture --include ./features/CBR_Multi_location_HIVCareContinuum  

TESTING PLIR SETUP

see PLIR-TEST

Public Domain Standard Notice

This repository constitutes a work of the United States Government and is not subject to domestic copyright protection under 17 USC § 105. This repository is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication. All contributions to this repository will be released under the CC0 dedication. By submitting a pull request you are agreeing to comply with this waiver of copyright interest.

License Standard Notice

The repository utilizes code licensed under the terms of the Apache Software License and therefore is licensed under ASL v2 or later.

This source code in this repository is free: you can redistribute it and/or modify it under the terms of the Apache Software License version 2, or (at your option) any later version.

This source code in this repository is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache Software License for more details.

You should have received a copy of the Apache Software License along with this program. If not, see http://www.apache.org/licenses/LICENSE-2.0.html

The source code forked from other open source projects will inherit its license.

Privacy Standard Notice

This repository contains only non-sensitive, publicly available data and information. All material and community participation is covered by the Disclaimer and Code of Conduct. For more information about CDC's privacy policy, please visit http://www.cdc.gov/other/privacy.html.

Contributing Standard Notice

Anyone is encouraged to contribute to the repository by forking and submitting a pull request. (If you are new to GitHub, you might start with a basic tutorial.) By contributing to this project, you grant a world-wide, royalty-free, perpetual, irrevocable, non-exclusive, transferable license to all users under the terms of the Apache Software License v2 or later.

All comments, messages, pull requests, and other submissions received through CDC including this GitHub page may be subject to applicable federal law, including but not limited to the Federal Records Act, and may be archived. Learn more at http://www.cdc.gov/other/privacy.html.

Records Management Standard Notice

This repository is not a source of government records, but is a copy to increase collaboration and collaborative potential. All government records will be published through the CDC web site.

Additional Standard Notices

Please refer to CDC's Template Repository for more information about contributing to this repository, public domain notices and disclaimers, and code of conduct.

hie-automation-tests's People

Contributors

leebrian avatar mozzy11 avatar nravilla avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.