Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor how Questionnaires are generated during the $apply operation #505

Merged
merged 38 commits into from
Oct 7, 2024

Conversation

barhodes
Copy link
Contributor

@barhodes barhodes commented Aug 19, 2024

  • The $apply operation will now always generate a Questionnaire from any action.input elements that reference a Profile. A populated QuestionnaireResponse will be returned with the generated Questionnaire contained within it.
  • Generated Questionnaire items from StructureDefinitions that reference a CPG Feature Expression will now have an SDC Questionnaire Item Population Context extension with the expression. The expression name will be set to the name of the StructureDefinition.
  • Added support for the SDC Questionnaire Launch Context extension in the $populate operation.
  • $populate now correctly expects the subject parameter to be a Reference rather than a String.
  • $populate will use "definition-based-population" with Item Population Context when the items have definitions.
  • $extract now uses the Questionnaire item for definition based extraction, the QuestionnaireResponse definition will only be used if the Questionnaire cannot be found by the server.
  • $extract now handles answers of type decimal or integer with a Questionnaire Unit extension correctly.
  • $extract now handles multiple resources being returned by the Item Extraction Context expression.
  • Added EvaluateProcessor for the Library/$evaluate operation.
  • Fixed operation processors not using the proxy repository when endpoints are passed in.
  • Added DataRequirementsVisitor and Processor for the $data-requirements operation.
  • $data-requirements operation added for the following resources: Library, PlanDefinition, Questionnaire, ValueSet

Closes #472
Closes #481
Closes #482

@barhodes barhodes added enhancement New feature or request CDS All issues related to the CDS project labels Aug 19, 2024
Copy link

github-actions bot commented Aug 19, 2024

Formatting check succeeded!

Copy link

codecov bot commented Aug 19, 2024

Codecov Report

Attention: Patch coverage is 85.44251% with 176 lines in your changes missing coverage. Please review.

Project coverage is 72.95%. Comparing base (b78a391) to head (cd75a4f).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...s/cqf/fhir/cr/visitor/DataRequirementsVisitor.java 86.20% 7 Missing and 9 partials ⚠️
...cqf/fhir/cr/plandefinition/apply/ApplyRequest.java 72.00% 4 Missing and 10 partials ⚠️
...onnaireresponse/extract/ProcessDefinitionItem.java 87.62% 3 Missing and 9 partials ⚠️
.../opencds/cqf/fhir/cr/library/LibraryProcessor.java 60.00% 6 Missing and 4 partials ⚠️
...questionnaire/populate/ProcessItemWithContext.java 90.74% 5 Missing and 5 partials ⚠️
.../cr/inputparameters/r4/InputParameterResolver.java 84.74% 4 Missing and 5 partials ⚠️
.../cr/inputparameters/r5/InputParameterResolver.java 84.74% 4 Missing and 5 partials ⚠️
...nnaireresponse/QuestionnaireResponseProcessor.java 76.31% 4 Missing and 5 partials ⚠️
.../cqf/fhir/cr/library/evaluate/EvaluateRequest.java 75.75% 4 Missing and 4 partials ⚠️
...qf/fhir/cr/questionnaire/populate/ProcessItem.java 83.33% 4 Missing and 4 partials ⚠️
... and 22 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #505      +/-   ##
============================================
+ Coverage     72.87%   72.95%   +0.07%     
  Complexity       19       19              
============================================
  Files           363      365       +2     
  Lines         18710    19308     +598     
  Branches       2880     2949      +69     
============================================
+ Hits          13635    14086     +451     
- Misses         3711     3800      +89     
- Partials       1364     1422      +58     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@barhodes barhodes force-pushed the questionnaire-generation-refactor-2 branch 2 times, most recently from 3d89e07 to a9a65a8 Compare September 3, 2024 13:57
@barhodes barhodes force-pushed the questionnaire-generation-refactor-2 branch from bccea4b to 5b1495b Compare September 17, 2024 23:17
@barhodes barhodes force-pushed the questionnaire-generation-refactor-2 branch from 758811a to 8e436c3 Compare September 30, 2024 18:31
@barhodes barhodes marked this pull request as ready for review October 3, 2024 17:40
@Capt-Mac
Copy link
Contributor

Capt-Mac commented Oct 4, 2024

decent handful of issues flagged, don't see anything majorly critical, but I'd have a look through https://sonarcloud.io/project/issues?id=cqframework_clinical-reasoning&pullRequest=505&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true before merging

@barhodes
Copy link
Contributor Author

barhodes commented Oct 7, 2024

decent handful of issues flagged, don't see anything majorly critical, but I'd have a look through https://sonarcloud.io/project/issues?id=cqframework_clinical-reasoning&pullRequest=505&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true before merging

Fixed all of them but the too many parameters in methods. Those will have to wait for another refactor.

Copy link

sonarcloud bot commented Oct 7, 2024

@barhodes barhodes merged commit f149779 into master Oct 7, 2024
8 checks passed
@barhodes barhodes deleted the questionnaire-generation-refactor-2 branch October 7, 2024 22:18
TahaAttari pushed a commit that referenced this pull request Oct 11, 2024
…#505)

* Refactor Questionnaire generation during $apply operation

* Add evaluate processor

* Fix operation processors not using the proxy repository when endpoints are passed in

* $extract now uses the Questionnaire item for definition based extraction

* Handle answers of type decimal or integer with a Questionnaire Unit extension

* spotless

* Add evaluate tests

* Add support for Questionnaire Launch Context extension in $populate

* Add tests for InputParameterResolver

* Add tests

* Refactor Item generation with Case Feature Expressions

* Add list of resources already packaged to prevent duplicate recursion

* Add method to construct custom library

* fix merge issues

* Add data requirements visitor and processor

* Add tests

* cleanup

* cleanup

* Add tests

* Add tests

* Add tests

* Add ValueSetProcessor with $package and $data-requirements operations

* Add tests and cleanup

* cleanup

* cleanup

* Strip non canonical relatedArtifacts from the module-definition returned from the CQL engine

* fix merge issue

* cleanup

* cleanup

* add tests

* cleanup

* Add tests

* Add tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CDS All issues related to the CDS project enhancement New feature or request
Projects
None yet
3 participants