Table of Contents |
---|
...
- Load NiFi and login with the credentials defined in
.env
for NiFi's NGINX - Confirm that the following six process groups have been loaded
- Generate MeasureReports
- Generate Measures
- Materialized Views
- Reference Data Connector
- Requisitions connector
- Superset Permissions
- Check that all passwords are loaded for controller services, InvokeHTTP processors and the global variables per process group are configured
- If processor groups are not already loaded and in a running state, the test has failed.
...
- Ensure the client username and password is loaded in for token generation for the following processors in Measures and Get MeasureReports process groups:
- Generate Measures > Get Measures > Invoke FHIR token
- Generate Measures > Generate products and measure list > Get Products > Get access token
- Generate MeasureReports > Get Measures > Invoke FHIR token
- Generate MeasureReports > Create Token > Get Access Token
- The client details are defined in the environment file and loaded in preload file
- If any of the Basic user authentication credentials is not loaded, the processor will output the following response and no measures or measure reports generated:
Code Block | ||
---|---|---|
| ||
{ "timestamp": "2019-06-06T14:33:18.300+0000", "status": 401, "error": "Unauthorized", "message": "Bad credentials", "path": "/api/oauth/token" } |
...
Test 6: Validate FHIR Locations are available
- Make a POST request to OpenLMIS with
grant_type=client_credentials
to generate a token with trusted-client credentials - Use the Bearer token above to make a GET request to the locations endpoint on FHIR server https://uat.openlmis.org/hapifhir/Location
- The result should be a JSON with various locations under the entry tree as sampled in the file fhir_locations.json
Test 7: Validate FHIR Measures are available
- Generate a token as in Test 6
- Using the Bearer token from the POST request, make a GET request to FHIR server to the measures endpoint
- The resulting JSON file is as follows fhir_measures.json
- Under the total, confirm that the total measures are 7 for the following expected measures:
- beginning_balance
- total_received_quantity
- total_consumed_quantity
- total_losses_and_adjustments
- total_stock_out_days
- stock_on_hand
- stock_status
Test 8: Validate the quality of each measure
- For each of the 7 measures don't reflect in FHIR server
- Get Measure Reports:
- Make a GET request to FHIR server for the 7 measures
- Get all requisitions with status approved or released
- For each of the requisitions, get their location reference from the FHIR server
- Check is a measureReport has been created for the requisition ID
- If not, POST a measure report for each of the 7 measures
- In FHIR server, confirm that 77 measure reports have been generated
- The test fails if all requisitions configured correctly to generate a measure report is not in FHIR server
Test 6: Validate FHIR Locations are available
- Make a POST request to OpenLMIS with
grant_type=client_credentials
to generate a token with trusted-client credentials - Use the Bearer token above to make a GET request to the locations endpoint on FHIR server https://uat.openlmis.org/hapifhir/Location
- The result should be a JSON with various locations under the entry tree as sampled in the file fhir_locations.json
Test 7: Validate FHIR Measures are available
- Generate a token as in Test 6
- Using the Bearer token from the POST request, make a GET request to FHIR server to the measures endpoint
- The resulting JSON file is as follows fhir_measures.json
- Under the total, confirm that the total measures are 7 for the following expected measures:
- beginning_balance
- total_received_quantity
- total_consumed_quantity
- total_losses_and_adjustments
- total_stock_out_days
- stock_on_hand
- stock_status
Test 8: Validate the quality of each measure
- For each of the 7 measures in FHIR server, ensure that it has the following fields:
- ResourceType
- id
- meta
- name
- Description
- Status
- Experimental
- Group
- Under each group is a dictionary of code text and description
- The measure format should be similar to the sampled Stock status measure
Test 9: Validate the measureReports are available
- Make a POST request to OpenLMIS with
grant_type=client_credentials
to generate a token with trusted-client credentials - Using the token, make a GET request to the MeasureReport endpoint
- The resulting JSON is a list of measure reports generated for the 7 measures using correctly formatted requisitions data
- The total number of measureReports is 77 for the 7 measures and valid 11 requisitions
Test 10: Validate the quality of 7 measureReports for one requisition
- For each measure report, the following fields are expected:
- The following JSON is expected for every measure report
- Each measure report should contain the following fields which can be compared to a requisition:
- resourceType: MeasureReport
- id: MeasureReport ID
- meta: versionID and lastUpdated fields
- identifier: This contains the requisition ID
- status: The requisition status
- type: The measureReport type
- measure: The measure ID
- reporter: Contains the location reference
- period: start and end dates
- group: This contains the programName and their measure scores
- Validate that the information in the measureReport is accurate compared to the source requisition by mapping the following:
- Location
- Requisition id
- Measure
- Period matches the requisition reporting period
- The values for each measure match what was reported in each requisition column
Test 11: Verify Requisition Creates 7 measureReports
- Login to UAT using administrator credentials
- Create a requisition which will be used to test that 7 measureReports are created for that single requisitions
- In NiFi, stop Generate MeasureReports process group and start it once the requisition is approved. At the end of the flow, the 7 reports should have been generated
- Make a POST request to the MeasureReport endpoint of FHIR server with the specific requisition ID as the identifier https://uat.openlmis.org/hapifhir/MeasureReport?identifier=requisition ID
- This will return a total of 7 measureReports sample as follows requisition_reports.json
Test 12: Verify the requisition updated the Superset dashboard
- The requisition that was created in Test 11 should also be able to update information in the superset dashboards that are embedded within OpenLMIS. Run through this document that Clay created: https://docs.google.com/document/d/1pVlgGXV9nb-nYlrTCRHS7Sor8ZrcnL59ch_Lnn2whZ0/edit?ts=5c864704in FHIR server, ensure that it has the following fields:
- ResourceType
- id
- meta
- name
- Description
- Status
- Experimental
- Group
- Under each group is a dictionary of code text and description
- The measure format should be similar to the sampled Stock status measure
Test 9: Validate the measureReports are available
- Make a POST request to OpenLMIS with
grant_type=client_credentials
to generate a token with trusted-client credentials - Using the token, make a GET request to the MeasureReport endpoint
- The resulting JSON is a list of measure reports generated for the 7 measures using correctly formatted requisitions data
- The total number of measureReports is 77 for the 7 measures and valid 11 requisitions
Test 10: Validate the quality of 7 measureReports for one requisition
- For each measure report, the following fields are expected:
- The following JSON is expected for every measure report
- Each measure report should contain the following fields which can be compared to a requisition:
- resourceType: MeasureReport
- id: MeasureReport ID
- meta: versionID and lastUpdated fields
- identifier: This contains the requisition ID
- status: The requisition status
- type: The measureReport type
- measure: The measure ID
- reporter: Contains the location reference
- period: start and end dates
- group: This contains the programName and their measure scores
- Validate that the information in the measureReport is accurate compared to the source requisition by mapping the following:
- Location
- Requisition id
- Measure
- Period matches the requisition reporting period
- The values for each measure match what was reported in each requisition column
Test 11: Verify Requisition Creates 7 measureReports
- Login to UAT using administrator credentials
- Create a requisition which will be used to test that 7 measureReports are created for that single requisitions
- In NiFi, stop Generate MeasureReports process group and start it once the requisition is approved. At the end of the flow, the 7 reports should have been generated
- Make a POST request to the MeasureReport endpoint of FHIR server with the specific requisition ID as the identifier https://uat.openlmis.org/hapifhir/MeasureReport?identifier=requisition ID
- This will return a total of 7 measureReports sample as follows requisition_reports.json
Test 12: Verify the requisition updated the Superset dashboard
- In NiFi, stop and start the requisitions connector and materialized view process groups to update the requisitions in the database
- Login to superset with administrator credentials to verify the new requisition is reflected in the dashboard
- In the dashboard list, select the Orders dashboard and use the appropriate filters used to create the requisition. The dashboard will change to display the single requisition as follows