Stream: cql
Topic: FSH and CQF Tooling
Richard Stanley (Aug 30 2021 at 15:21):
Hi @Bryn Rhodes @JP Per our conversation earlier, I'm trying to make the CQFTooling work with FSH. Here are (roughly) the steps I'm following to use CQFTooling with FSH.
- copy in the _refresh and _updateCQFTooling scripts to the IG.
- run _update
bash _updateCQFTooling.sh
- change the vars in refresh script:
# resources_path=$PWD/input/resources
resources_path=$PWD/fsh-generated/resources
# ig_resource_path=./input/anc-cds.xml
ig_resource_path=./fsh-generated/resources/ImplementationGuide-simple.hiv.ig.json
FYI, FHIR Helpers, Common and Model-Info are all in CQL format.
Process:
- run sushi
- try refresh...
<output of _refresh>
No paths found for the Directory /Users/richard/src/github.com/intrahealth/simple-hiv-ig/input/tests/measure/KitchenSink:
java.lang.NullPointerException
at java.base/java.util.Objects.requireNonNull(Objects.java:208)
at java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:260)
at java.base/java.nio.file.Path.of(Path.java:147)
at java.base/java.nio.file.Paths.get(Paths.java:69)
at org.opencds.cqf.tooling.utilities.IOUtils.copyFile(IOUtils.java:164)
at org.opencds.cqf.tooling.measure.MeasureProcessor.bundleFiles(MeasureProcessor.java:193)
at org.opencds.cqf.tooling.measure.MeasureProcessor.bundleMeasures(MeasureProcessor.java:142)
at org.opencds.cqf.tooling.processor.IGBundleProcessor.bundleIg(IGBundleProcessor.java:25)
at org.opencds.cqf.tooling.processor.IGProcessor.publishIG(IGProcessor.java:79)
at org.opencds.cqf.tooling.operation.RefreshIGOperation.execute(RefreshIGOperation.java:34)
at org.opencds.cqf.tooling.Main.main(Main.java:208)
The tooling seems to expect some stuff in resources/tests/measure/MeasureName whereas the Atom plugin is fine with tests/MeasureName
Richard Stanley (Aug 30 2021 at 15:31):
If I put copy tests over into a measure/ dir, then the next error is that it cant find FHIR Helpers.
java.lang.RuntimeException: /Users/richard/src/github.com/intrahealth/simple-hiv-ig/fsh-generated/resources/FHIRHelpers.json (No such file or directory)
at org.opencds.cqf.tooling.utilities.IOUtils.readResource(IOUtils.java:240)
at org.opencds.cqf.tooling.utilities.IOUtils.readResource(IOUtils.java:203)
at org.opencds.cqf.tooling.utilities.ResourceUtils.getR4DepLibraryResources(ResourceUtils.java:219)
at org.opencds.cqf.tooling.utilities.ResourceUtils.getDepLibraryResources(ResourceUtils.java:136)
at org.opencds.cqf.tooling.library.LibraryProcessor.bundleLibraryDependencies(LibraryProcessor.java:67)
at org.opencds.cqf.tooling.measure.MeasureProcessor.bundleMeasures(MeasureProcessor.java:124)
at org.opencds.cqf.tooling.processor.IGBundleProcessor.bundleIg(IGBundleProcessor.java:25)
at org.opencds.cqf.tooling.processor.IGProcessor.publishIG(IGProcessor.java:79)
at org.opencds.cqf.tooling.operation.RefreshIGOperation.execute(RefreshIGOperation.java:34)
at org.opencds.cqf.tooling.Main.main(Main.java:208)
11:30:15.713 [main] WARN o.o.cqf.tooling.utilities.LogUtils - Measure will not be bundled because Library Dependency bundling failed.
Richard Stanley (Aug 30 2021 at 15:32):
This is because FSH prefixes files with their resource, type, ie. Library-FHIRHelpers
Alex Goel (Oct 21 2021 at 22:31):
@David Winters put together something pretty cool here using FSH to make PlanDefinitions and ActivityDefinitions for this Cervical Cancer CDS use case: https://github.com/ccsm-cds-tools/ccsm-cds-with-tests
It would be neat to turn this into a template for making CPGs. Right now I feel like the CQF-tooling does making spreadsheets and CQL into CPGs, but making PlanDefinitions and ActivityDefinitions requires a lot of manual work, which can be handled more easily by FSH. It would be great to get this on the CQF Github, once the templates are made
David Winters (Oct 22 2021 at 12:48):
I think this is a great idea and it isn't something that occurred to @Michael O'Hanlon and I when we started ccsm-cds-with-tests. If there was a community template for making CPGs with FSH we would transition over to using it.
Alex Goel (Oct 22 2021 at 13:12):
I think CCSM is a good place to start making the template. Take a PD and an AD then strip out the CCSM stuff.
Alex Goel (Oct 22 2021 at 13:13):
The more challenging part is what @Bryn Rhodes pointed out with the CQF-Tooling/publisher needing updates to accomodate FSH
Richard Stanley (Oct 22 2021 at 13:31):
FWIW, my method to doing FSH->CQL right now is:
# remove these from a previous run or you'll get a dupe error
# the rm -rf approach is a bit harsh, check your IG to make sure you don't have ones that FSH doesn't generate
rm -rf input/resources/Library-* input/resources/library-*
# sushi as usual but with FSHOnly: true
sushi
mv fsh-generated/resources/Library-* input/resources/
# now use the cqf tooling script
bash _refresh.sh
bash _genonce.sh -no-sushi
The only limitation is that the publisher needs to use the XML template for IGs (input/my-ig.xml), meaning that Sushi can't be used for creating the IG. Or, at least I couldn't make it work. IIRC, the issue is that you need Publisher to use sushi or it can't find all of the IG resources.
Last updated: Apr 12 2022 at 19:14 UTC