cqframework / opioid-cds-r4

CDC Opioid Prescribing Support Guideline (for FHIR R4)
Other
5 stars 3 forks source link

v2016 - remove Request-Resource from prefetch in all request tests #258

Closed bryantaustin13 closed 11 months ago

bryantaustin13 commented 1 year ago

The prefetch items in pagecontent/request example requests have this: "item1": { "response": { "status": "200 OK" }, "resource": {

It needs to be removed from all prefetches, along with the trailing “}”. It is no longer needed and is incorrect.

Was OPD-97

brynrhodes commented 1 year ago

Blocked on PR: https://github.com/cqframework/cqf-tooling/pull/409

alackerbauer commented 1 year ago

additional information: Essentially the same that was already done in master (https://github.com/cqframework/opioid-cds-r4/pull/308) for the 2016 branch. We will need some updates in the tooling before we can merge.

alackerbauer commented 1 year ago

merge request: https://github.com/cqframework/opioid-cds-r4/pull/317 (closed because was based on incorrect branch)

new merge request: for 2016 branch https://github.com/cqframework/opioid-cds-r4/pull/339

alackerbauer commented 1 year ago

changes done, tested JSON syntax for all requests, thunder client tests unsuccessful for now, since we rely on an update of the CQF tooling. will test again later this week.

alackerbauer commented 1 year ago

I have updated the tooling to 2.4.0, but the script for refreshing test data throws an error:

Refreshing Test Data...
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: java.lang.NullPointerException: Cannot invoke "com.google.gson.JsonElement.isJsonNull()" because the return value of "com.google.gson.JsonObject.get(String)" is null
        at org.opencds.cqf.tooling.dateroller.HookDataDateRoller.rollPrefetchItemsDates(HookDataDateRoller.java:67)
        at org.opencds.cqf.tooling.dateroller.HookDataDateRoller.rollJSONHookDates(HookDataDateRoller.java:36)
        at org.opencds.cqf.tooling.dateroller.DataDateRollerOperation.rollDatesInFile(DataDateRollerOperation.java:102)
        at org.opencds.cqf.tooling.dateroller.DataDateRollerOperation.processFiles(DataDateRollerOperation.java:78)
        at org.opencds.cqf.tooling.dateroller.DataDateRollerOperation.processFiles(DataDateRollerOperation.java:72)
        at org.opencds.cqf.tooling.dateroller.DataDateRollerOperation.rollAllDates(DataDateRollerOperation.java:65)
        at org.opencds.cqf.tooling.dateroller.DataDateRollerOperation.execute(DataDateRollerOperation.java:57)
        at org.opencds.cqf.tooling.cli.Main.main(Main.java:235)
        ... 8 more
alackerbauer commented 1 year ago

added the "item2" that caused this exception.

two tests fail for recommendation 7, all passed with the old tooling in branch v2016. i updated the related request file to double check, but they are still failing.

Image

alackerbauer commented 1 year ago

I found that, with updated tooling to 2.4.0, after running sh _refreshTestData.sh, an interesting resource element is added as the last element of the item, including the "refreshed" entire resource as a copy. This might be causing the problem.

alackerbauer commented 1 year ago

fixed here: https://github.com/cqframework/cqf-tooling/pull/439, tested with opioid files by calling JAVA -jar tooling-cli-2.5.0-SNAPSHOT.jar -RollTestsDataDates -v=r4 -ip="path/to/opioid/file/to/test"with a jar files packaged from the change in #439. no nesting is happening, the dates are rolled correctly, only the order of the JSON prefetch items change since JsonObject is unordered. See example diff here: https://www.diffchecker.com/xaJD9u2U/

c-schuler commented 11 months ago

Resolved in #339