Skip to content

Commit

Permalink
Merge pull request #202 from cqframework/recommendation-tests
Browse files Browse the repository at this point in the history
Recommendation testing
  • Loading branch information
bryantaustin13 authored Aug 22, 2022
2 parents 2752bd0 + 5870b59 commit 4e5710a
Show file tree
Hide file tree
Showing 265 changed files with 9,315 additions and 14,901 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"liveServer.settings.port": 5501
"liveServer.settings.port": 5501,
"thunder-client.saveToWorkspace": true
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ The guide currently includes artifacts to support all 12 recommendations contain

Feedback and issues can be submitted via the [issues](issues) page, and will be incorporated into subsequent releases as time and resources allow.

Contributions must follow the commit policy defined [here](/commit_policy.md)

## Repository and Build Information

This repository contains the source for the Opioid Prescribing Support Implementation Guide, and uses the [FHIR Implementation Guide publisher](http://wiki.hl7.org/index.php?title=IG_Publisher_Documentation) to produce a FHIR Implementation Guide.
Expand Down
3 changes: 2 additions & 1 deletion _refresh.bat
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ SET JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8
IF EXIST "%input_cache_path%\%tooling_jar%" (
ECHO running: JAVA -jar "%input_cache_path%\%tooling_jar%" -RefreshIG -ini="%ig_ini_path%" -rp="%resources_path%" -t -d -p %fsoption%
JAVA -jar "%input_cache_path%\%tooling_jar%" -RefreshIG -ini="%ig_ini_path%" -rp="%resources_path%" -t -d -p %fsoption%
CALL ./_refreshTestData.bat -watch
) ELSE If exist "..\%tooling_jar%" (
ECHO running: JAVA -jar "..\%tooling_jar%" -RefreshIG -ini="%ig_ini_path%" -rp="%resources_path%" -t -d -p %fsoption%
JAVA -jar "..\%tooling_jar%" -RefreshIG -ini="%ig_ini_path%" -rp="%resources_path%" -t -d -p %fsoption%
CALL ./_refreshTestData.bat -watch
) ELSE (
ECHO IG Refresh NOT FOUND in input-cache or parent folder. Please run _updateCQFTooling. Aborting...
)


PAUSE
3 changes: 2 additions & 1 deletion _refresh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ echo "$fsoption"
tooling=$input_cache_path/$tooling_jar
if test -f "$tooling"; then
JAVA -jar $tooling -RefreshIG -ini="$ig_ini_path" -rp="$resources_path" -d -p -t -ss=false $fsoption
chmod +x ./_refreshTestData.sh
else
tooling=../$tooling_jar
echo $tooling
if test -f "$tooling"; then
JAVA -jar $tooling -RefreshIG -ini="$ig_ini_path" -rp="$resources_path" -d -p -t -ss=false $fsoption
chmod +x ./_refreshTestData.sh
else
echo IG Refresh NOT FOUND in input-cache or parent folder. Please run _updateCQFTooling. Aborting...
fi
fi

19 changes: 19 additions & 0 deletions _refreshTestData.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@ECHO OFF
SET tooling_jar=tooling-1.4.1-SNAPSHOT-jar-with-dependencies.jar
SET input_cache_path=%~dp0/input-cache
SET patient_data_bundles=%~dp0/input/examples
SET service_requests=%~dp0/input/pagecontent/requests

SET JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8

IF EXIST "%input_cache_path%\%tooling_jar%" (
JAVA -jar "%input_cache_path%\%tooling_jar%" -RollTestsDataDates -v=r4 -ip="%patient_data_bundles%"
JAVA -jar "%input_cache_path%\%tooling_jar%" -RollTestsDataDates -v=r4 -ip="%service_requests%"
) ELSE If exist "..\%tooling_jar%" (
JAVA -jar "..\%tooling_jar%" -RollTestsDataDates -v=r4 -ip="%patient_data_bundles%"
JAVA -jar "..\%tooling_jar%" -RollTestsDataDates -v=r4 -ip="%service_requests%"
) ELSE (
ECHO IG Refresh NOT FOUND in input-cache or parent folder. Please run _updateCQFTooling. Aborting...
)

PAUSE
23 changes: 23 additions & 0 deletions _refreshTestData.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
#DO NOT EDIT WITH WINDOWS
tooling_jar=tooling-1.4.1-SNAPSHOT-jar-with-dependencies.jar
input_cache_path=$PWD/input-cache
patient_data_bundles=$PWD/input/examples
service_requests=$PWD/input/pagecontent/requests

echo Refreshing Test Data...

tooling=$input_cache_path/$tooling_jar
if test -f "$tooling"; then
JAVA -jar $tooling -RollTestsDataDates -v=r4 -ip="$patient_data_bundles"
JAVA -jar $tooling -RollTestsDataDates -v=r4 -ip="$service_requests"
else
tooling=../$tooling_jar
echo $tooling
if test -f "$tooling"; then
JAVA -jar $tooling -RollTestsDataDates -v=r4 -ip="$patient_data_bundles"
JAVA -jar $tooling -RollTestsDataDates -v=r4 -ip="$service_requests"
else
echo IG Refresh NOT FOUND in input-cache or parent folder. Please run _updateCQFTooling. Aborting...
fi
fi
22 changes: 22 additions & 0 deletions commit_policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Commit Policy

All new development takes place on `<feature>` branches off `master`. Once feature development on the branch is complete, the feature branch is submitted to `master` as a PR. The PR is reviewed by maintainers and testing is performed by the reviewer (see the [Testing](#testing) section for more information).

Changes to the `master` branch must be done through an approved PR. Delete branches after merging to keep the repository clean.

### Testing
Testing _MUST_ be performed when a PR contains changes to the CQL or knowledge artifacts. The PR author _SHOULD_ test their changes and the reviewer _MUST_ test the changes before approving and merging the PR. Testing is performed using the Thunder Client test suite located at the root of this project (`thunder-tests` directory).

Follow the following steps to run the test suite:

1. Install the [Thunder Client](https://www.thunderclient.com) VSCode extension
2. Navigate to the Thunder Client extension by clicking on the lightning bolt icon in the left sidebar menu
3. Set the `fhirServer` and `cdsHooksServer` environment variables by navigating to the `Env` tab and selecting the `OPIOID_TEST_LOCAL` environment
- The `fhirServer` variable points to the base URL of a FHIR server (used for transaction operations). Note that this endpoint _MUST_ be the same as the `fhirServer` property defined in the CDS Hooks requests that are being tested.
- The `cdsHooksServer` variable points to a CDS Hooks server discovery endpoint
4. Run the _refresh and _updateTestData scripts
- The result of running these operations _MUST_ be committed to the PR either by the PR author or reviewer
5. Run the test suite by navigating to the `Collections` tab, click the ellipsis next to the `OpioidCDSR4_Test_Suite` collection and select `Run All`
6. All tests _MUST_ pass before a PR will be approved and merged

To update the test suite, ensure that your Thunder Client extension is configured with [Git Sync](https://github.com/rangav/thunder-client-support#git-sync)

This file was deleted.

120 changes: 0 additions & 120 deletions input/examples/bundle-example-rec-01-true-make-recommendations.json

This file was deleted.

Loading

0 comments on commit 4e5710a

Please sign in to comment.