Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
drdavec committed Dec 19, 2024
2 parents 583aa81 + c3a40db commit 9847337
Show file tree
Hide file tree
Showing 58 changed files with 9,943 additions and 76,224 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
bundle install
- name: Update Publisher executable
run: bash _updatePublisher.sh --force --yes --skip-ping
run: bash _updatePublisher.sh --force --yes

- name: Generate Implementation Guide (IG)
run: bash _genonce.sh
Expand Down
11 changes: 6 additions & 5 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
fileignoreconfig:
- filename: cql-unit-tests/package-lock.json
checksum: 1abc3447c829e856923f3031986fadb76ca930f3686d268e1e46cb0b612802e0
- filename: input/vocabulary/ValueSet/valueset-covid-19-condition-risk-obstructive-sleep-apnea-icd10.json
checksum: 2387dad07ac00f6b5ecd0bd346088d5607484205945b2057b07f681692d2a531
checksum: 7869cce478539463891fc26b8b1a94b64d02c988c2bbd43e8c80b2b19e596faa
- filename: input/cql/valueset-db.json
checksum: fbba042ed60f0f2c80980e25a4b7ff6b569853431e3cce53686d7bddd20546b7
- filename: input/vocabulary/ValueSet/valueset-covid-19-condition-risk-downs-syndrome-icd10.json
checksum: 4cb0e0a2b14d4f37c02f10cf5dd4012f5f61cbb139d0edb5220a5a4f1e782a52
- filename: input/vocabulary/ValueSet/valueset-covid-19-condition-risk-obstructive-sleep-apnea-icd10.json
checksum: 2387dad07ac00f6b5ecd0bd346088d5607484205945b2057b07f681692d2a531
- filename: input/vocabulary/ValueSet/valueset-vsac-covid19-diabetes-snomed.json
checksum: 9452adceb8d25afec1621ae487944be99f93c27ad2f1b2a1daa9a68402aa9591
- filename: input/cql/valueset-db.json
checksum: fbba042ed60f0f2c80980e25a4b7ff6b569853431e3cce53686d7bddd20546b7
version: "1.0"
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,23 @@ Documentation for the IG-Publisher is available at [https://confluence.hl7.org/d

#### Ruby / Jekyll

Jekyll requires Ruby version 2.1 or greater. Depending on your operating system, you may already have Ruby bundled with it. Otherwise, or if you need a newer version, go to [https://www.ruby-lang.org/en/downloads/](https://www.ruby-lang.org/en/downloads/) for directions.
FIRST, Install Ruby through a Ruby version manager (rvm/rbenv/chruby) and then install Jekyll.
`brew install rbenv`
`rbnev init`
add `eval "$(rbenv init - zsh)"` to `~/.zshrc` or where your profile settings are.
`rbenv install 3.1.0`
`rbenv global 3.1.0`

Jekyll
Jekyll requires Ruby version 2.1 or greater.
`ruby -v`

Go to [https://jekyllrb.com](https://jekyllrb.com) and follow the instructions there, for example gem install jekyll bundler. The end result of this should be that the binary "jekyll" is now in your path.
Jekyll `gem install --user-install bundler jekyll`
If `jekyll -v` doesn't work, add `export PATH="/Users/<your-username>/.gem/ruby/3.1.0/bin:$PATH"` to your `~/.zshrc` or where your profile settings are.
Try `bundle exec jekyll -v` if `jekyll -v` still doesn't work.

If installing on a macOS: [https://jekyllrb.com/docs/installation/macos/](https://jekyllrb.com/docs/installation/macos/)

Go to [https://jekyllrb.com](https://jekyllrb.com) for more information.

### Build

Expand Down Expand Up @@ -160,9 +172,7 @@ There are a couple of ways to test the CQL.
## Updating Valuesets
If new codes need to be added to a valueset, follow these steps to manually update the JSON and regenerate the `valueset-db.json` file:
1. Add new codes to the relevant JSON files in `input/vocabulary/valueset`. For labs, add to both the `compose` and `expansion` objects.
2. Run `./_updateCQFTooling.sh` script, which updates the [CQF Tooling](https://github.com/cqframework/cqf-tooling) and downloads the `jar` file into `input-cache` directory.
3. Run `java -jar input-cache/tooling-1.3.1-SNAPSHOT-jar-with-dependencies.jar -ToJsonValueSetDb -path="input/vocabulary/valueset"` (note: this is the path to the entire valueset folder)
4. The new `valueset-db.json` can be found in `src/main/resources/org/opencds/cqf/tooling/terminology/output`. Copy this over into the `input/cql` directory to replace it.
2. Run `./_updateValueSet.sh`. This updates the CQF tooling, generates the new valueset, copies it to the `./input/cql` folder and then updates `healthCodes.json` with the new codes as well.

# CQL Development Resources

Expand Down
1 change: 1 addition & 0 deletions _publishToRepo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ node updatePackage.js --release-tag $releaseTag
cp ./output/*.cql ./output/package/ # Copy over original CQL
cp ./output/*-2.json ./output/package/ # Copy over original json+eml
cp ./input/cql/valueset-db.json ./output/package/
cp ./input/cql/healthCodes.json ./output/package/
node localizeLibraryPaths.js ./output/package/*-2.json
echo "registry=https://npm.pkg.github.com/chronic-care" >> ./output/package/.npmrc
cd ./output/package
Expand Down
2 changes: 1 addition & 1 deletion _updatePublisher.bat
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,4 @@ start copy /y "_updatePublisher.new.bat" "_updatePublisher.bat" ^&^& del "_updat

IF "%skipPrompts%"=="true" (
PAUSE
}
)
22 changes: 7 additions & 15 deletions _updatePublisher.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ dlurl=$pubsource$publisher_jar

input_cache_path=$PWD/input-cache/

scriptdlroot=https://raw.githubusercontent.com/FHIR/sample-ig/master
scriptdlroot=https://raw.githubusercontent.com/HL7/ig-publisher-scripts/main
update_bat_url=$scriptdlroot/_updatePublisher.bat
gen_bat_url=$scriptdlroot/_genonce.bat
gencont_bat_url=$scriptdlroot/_gencontinuous.bat
gencont_sh_url=$scriptdlroot/_gencontinuous.sh
gen_sh_url=$scriptdlroot/_genonce.sh
update_sh_url=$scriptdlroot/_updatePublisher.sh

skipPing=false
skipPrompts=false
FORCE=false

Expand All @@ -24,26 +23,19 @@ fi

while [ "$#" -gt 0 ]; do
case $1 in
--skip-ping) skipPing=true ;;
-f|--force) FORCE=true ;;
-y|--yes) skipPrompts=true ; FORCE=true ;;
*) echo "Unknown parameter passed: $1. Exiting"; exit 1 ;;
esac
shift
done

if [[ $skipPing == false ]]; then
echo "Checking internet connection"
case "$OSTYPE" in
linux-gnu* ) ping tx.fhir.org -4 -c 1 -w 30 >/dev/null ;;
darwin* ) ping tx.fhir.org -c 1 >/dev/null ;;
*) echo "unknown: $OSTYPE"; exit 1 ;;
esac

if [ $? -ne 0 ] ; then
echo "Offline (or the terminology server is down), unable to update. Exiting"
exit 1
fi
echo "Checking internet connection"
curl -sSf tx.fhir.org > /dev/null

if [ $? -ne 0 ] ; then
echo "Offline (or the terminology server is down), unable to update. Exiting"
exit 1
fi

if [ ! -d "$input_cache_path" ] ; then
Expand Down
12 changes: 12 additions & 0 deletions _updateValueSet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

echo Update CQF Tooling ...
./_updateCQFTooling.sh

java -jar input-cache/tooling-1.3.1-SNAPSHOT-jar-with-dependencies.jar -ToJsonValueSetDb -path="input/vocabulary/valueset"
echo Generated valueset at input/vocabulary/valueset

cp src/main/resources/org/opencds/cqf/tooling/terminology/output/valueset-db.json ./input/cql/valueset-db.json
echo Copied valueset-db.json to ./input/cql folder.

node ./parseHealthCodes.js
2 changes: 2 additions & 0 deletions cql-unit-tests/bin/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

echo "Generating compiled CQL..."
./_genonce.sh && \
echo "Updating healthcodes ..." && \
./_updateValueSet.sh && \
echo "Localizing library paths..." && \
node ./localizeLibraryPaths.js ./output/*-2.json && \
cd cql-unit-tests && \
Expand Down
92 changes: 65 additions & 27 deletions cql-unit-tests/helpers/builders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,40 +39,78 @@ export const buildDefaultPatientDataParameters = (overrides: Partial<PatientData

export const buildDefaultRiskAssessmentScoreParameters = (overrides: Partial<RiskAssessmentScoreParameters> = {}): RiskAssessmentScoreParameters => {
const riskAssessmentScoreParameters: RiskAssessmentScoreParameters = {
Cancer: false,
CardiovascularDisease: false,
ChronicRespiratoryDisease: false,
DiabetesType2: false,
DownsSyndrome: false,
Hypertension: false,
Immunosuppression: false,
NeurologicDisease: false,
Obesity: false,
ObstructiveSleepApnea: false,
Pregnancy: false,
RenalDisease: false,
SteroidUsage: false,
Bronchiectasis: false,
BronchopulmonaryDysplasia: false,
PulmonaryHypertension: false,
PulmonaryEmbolism: false,
Cancer: false,
CerebrovascularDisease: false,
ChronicKidneyDisease: false,
ChronicLiverDisease: false,
COPD: false,
DiabetesMellitus: false,
HeartConditions: false,
InterstitialLungDisease: false,
CurrentAndFormerSmoking: false,
Tuberculosis: false,
Obesity: false,
PregnancyAndRecentPregnancy: false,
MentalHealthDisorders: false,
ChildrenWithCertainUnderlyingConditions: false,
DownSyndrome: false,
HIV: false,
NeurologicConditions: false,
Overweight: false,
SickleCellDisease: false,
SolidOrganOrBloodStemTransplantation: false,
SubstanceUseDisorders: false,
Corticosteroids: false,
ImmunosuppressiveMedications: false,
CysticFibrosis: false,
Thalassemia: false,
Asthma: false,
Hypertension: false,
ImmuneDeficiencies: false
};

return buildWithOverrides(riskAssessmentScoreParameters, overrides);
};

export const buildAllNullRiskAssessmentScoreParameters = (): RiskAssessmentScoreParameters => {
const riskAssessmentScoreParameters: RiskAssessmentScoreParameters = {
Cancer: null,
CardiovascularDisease: null,
ChronicRespiratoryDisease: null,
DiabetesType2: null,
DownsSyndrome: null,
Hypertension: null,
Immunosuppression: null,
NeurologicDisease: null,
Obesity: null,
ObstructiveSleepApnea: null,
Pregnancy: null,
RenalDisease: null,
SteroidUsage: null,
Bronchiectasis: null,
BronchopulmonaryDysplasia: null,
PulmonaryHypertension: null,
PulmonaryEmbolism: null,
Cancer: null,
CerebrovascularDisease: null,
ChronicKidneyDisease: null,
ChronicLiverDisease: null,
COPD: null,
DiabetesMellitus: null,
HeartConditions: null,
InterstitialLungDisease: null,
CurrentAndFormerSmoking: null,
Tuberculosis: null,
Obesity: null,
PregnancyAndRecentPregnancy: null,
MentalHealthDisorders: null,
ChildrenWithCertainUnderlyingConditions: null,
DownSyndrome: null,
HIV: null,
NeurologicConditions: null,
Overweight: null,
SickleCellDisease: null,
SolidOrganOrBloodStemTransplantation: null,
SubstanceUseDisorders: null,
Corticosteroids: null,
ImmunosuppressiveMedications: null,
CysticFibrosis: null,
Thalassemia: null,
Asthma: null,
Hypertension: null,
ImmuneDeficiencies: null
};

return buildWithOverrides(riskAssessmentScoreParameters, {});
};
};
15 changes: 8 additions & 7 deletions cql-unit-tests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cql-unit-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"@ahryman40k/ts-fhir-types": "^4.0.34",
"cql-exec-fhir": "^2.0.0",
"cql-execution": "^2.3.1"
"cql-execution": "^2.3.3"
},
"devDependencies": {
"@babel/plugin-proposal-class-properties": "^7.13.0",
Expand Down
Loading

0 comments on commit 9847337

Please sign in to comment.