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

Open
wants to merge 29 commits into
base: master
Choose a base branch
from

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 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.39823% with 165 lines in your changes missing coverage. Please review.

Project coverage is 72.91%. Comparing base (bd2018d) to head (1292dec).

Files with missing lines Patch % Lines
...s/cqf/fhir/cr/visitor/DataRequirementsVisitor.java 86.20% 7 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 ⚠️
...cqf/fhir/cr/plandefinition/apply/ApplyRequest.java 78.57% 4 Missing and 5 partials ⚠️
...onnaireresponse/extract/ProcessDefinitionItem.java 89.65% 1 Missing and 8 partials ⚠️
.../questionnaireresponse/extract/ExtractRequest.java 68.00% 7 Missing and 1 partial ⚠️
...ncds/cqf/fhir/cr/common/IQuestionnaireRequest.java 82.35% 2 Missing and 4 partials ⚠️
.../cqf/fhir/cr/library/evaluate/EvaluateRequest.java 79.31% 4 Missing and 2 partials ⚠️
... and 24 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #505      +/-   ##
============================================
+ Coverage     72.61%   72.91%   +0.30%     
  Complexity       19       19              
============================================
  Files           362      366       +4     
  Lines         18603    19345     +742     
  Branches       2874     2961      +87     
============================================
+ Hits          13508    14106     +598     
- Misses         3734     3815      +81     
- Partials       1361     1424      +63     

☔ 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
.anyMatch(lc -> lc.getExtension().stream()
.map(c -> (IBaseExtension<?, ?>) c)
.anyMatch(c -> c.getUrl().equals("name")
&& resolvePathString(c.getValue(), "code")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

potential NPE if code = null?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed! Thank's for catching that!

Copy link

sonarcloud bot commented Oct 4, 2024

@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

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