cqframework / cqframework/clinical-reasoning

Expansion in context of Packaging is passing incorrect arguments and failing for value sets with definition containing both codes and ValueSet references

Open
#856 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
49
Forks
43
Avg merge
2d 19h
Merged PRs (30d)
13

Description

As part of the $package operation processing, the PackageVisitor.handleValueSets method calls the ExpandHelper.expandValueSet method. In the case that the ValueSet's definition contains both a ValueSet reference and explicit code includes (i.e., it has neither a "simple compose" nor a "grouping compose"), it invokes the $expand operation (ValueSetOperationProvider.expand) via HapiFhirRepository.invoke. Then, in BaseResourceReturningMethodBinding.doInvokeServer, the RequestDetails are mapped into method parameters. The problem is that the RequestDetails are those of the outer $package request, so 'theID' is the ID of the Library being packaged. The expansion parameters include the VS URL and Version. JpaResourceDaoValueSet.expand explicitly disallows having both the ID and URL.

Steps to reproduce:

  • Post a package that includes a Library (manifest) that references a ValueSet whose definition includes both explicit code includes and a ValueSet reference.
  • Invoke Library.$package on the Library
  • Expansion of the referenced ValueSet should fail for the reason described above

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at PackageVisitor.handleValueSets and trace the call through ExpandHelper.expandValueSet, ValueSetOperationProvider.expand, HapiFhirRepository.invoke, and BaseResourceReturningMethodBinding.doInvokeServer. Reproduce the Library.$package scenario with a mixed ValueSet definition, then verify that expansion no longer maps the outer package request's Library ID together with the ValueSet URL and version.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.