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

Add race and ethnicity bindings to bindings collection #531

Merged
merged 5 commits into from
Aug 20, 2024

Conversation

bryantaustin13
Copy link
Contributor

@bryantaustin13 bryantaustin13 commented Jun 10, 2024

Issue #433 QI Core Value Set and Code System Query Issue
Description

visitExtensions was added to StructureDefinitionElementBindingVisitor to visit the extensions and collect the bindings especially for patient.extension:race and patient.extension:ethnicity.

  • Github Issue:
  • [X ] I've read the contribution guidelines
  • [ X] Code compiles without errors
  • Tests are created / updated
  • Documentation is created / updated

By creating this PR you acknowledge that your contribution will be licensed under Apache 2.0

Copy link

codecov bot commented Jun 10, 2024

Codecov Report

Attention: Patch coverage is 0% with 90 lines in your changes missing coverage. Please review.

Project coverage is 21.85%. Comparing base (7a04aaf) to head (c433981).
Report is 1 commits behind head on master.

Files Patch % Lines
...rkit/StructureDefinitionElementBindingVisitor.java 0.00% 77 Missing ⚠️
...s/cqf/tooling/operation/ProfilesToSpreadsheet.java 0.00% 12 Missing ⚠️
...tooling/operation/QICoreElementsToSpreadsheet.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #531      +/-   ##
============================================
- Coverage     21.91%   21.85%   -0.06%     
- Complexity     1672     1673       +1     
============================================
  Files           297      297              
  Lines         25317    25390      +73     
  Branches       3990     4005      +15     
============================================
+ Hits           5548     5550       +2     
- Misses        18848    18920      +72     
+ Partials        921      920       -1     

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

Copy link
Contributor

@c-schuler c-schuler left a comment

Choose a reason for hiding this comment

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

I am not able to test anything in this PR, so I am unable to verify functionality. A few small changes requested and some comments.

Nice work!

@@ -121,10 +121,84 @@ private void getBindings(String sdName, List<ElementDefinition> eds, String sdUR
sdbo.setBindingValueSetVersion(valueSetVersion);
bindingObjects.put(sdName + "." + sdbo.getElementId(), sdbo);
}
else if(ed.getId().equalsIgnoreCase("patient.extension:race")
Copy link
Contributor

Choose a reason for hiding this comment

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

I may be missing some context, but is this really what we want here? Seems like we want to generalize this for all potential extensions with bindings, right? Something like ed.hasExtension() or type checking on the ElementDefinition.

Copy link
Contributor

Choose a reason for hiding this comment

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

Applied

}
sdbo.setBindingValueSetVersion(valueSetVersion);
if (null != elementValueSet) {
StringBuilder codeSystemURLs = new StringBuilder();;
Copy link
Contributor

Choose a reason for hiding this comment

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

Extra ";"

Copy link
Contributor

Choose a reason for hiding this comment

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

Applied

StringBuilder codeSystemURLs = new StringBuilder();;
Map<String, String> codeSystemsMap = new HashMap<>();
getValueSetCodeSystems(elementValueSet, codeSystemsMap);
if(null != codeSystemsMap && !codeSystemsMap.isEmpty()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

codeSystemsMap will never be null (see line 181)

Copy link
Contributor

Choose a reason for hiding this comment

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

Applied

valueSetVersion = this.canonicalResourceDependenciesAtlas.getValueSets().getByCanonicalUrlWithVersion(sdbo.getBindingValueSetURL()).getVersion();
sdbo.setBindingValueSetName(this.canonicalResourceDependenciesAtlas.getValueSets().getByCanonicalUrlWithVersion(sdbo.getBindingValueSetURL()).getName());
elementValueSet = this.canonicalResourceDependenciesAtlas.getValueSets().getByCanonicalUrlWithVersion(sdbo.getBindingValueSetURL());
} else if (valueSetVersion.length() < 1 && bindingValueSet.contains("|")) {
Copy link
Contributor

@c-schuler c-schuler Jul 2, 2024

Choose a reason for hiding this comment

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

Is checking the valueSetVersion string length necessary here? Seems like it is set in the previous if statements. If it is necessary, use valueSetVersion.isEmpty().

CanonicalType canonicalType = new CanonicalType();
canonicalType.setValue(String.valueOf(ed.getType().get(0).getProfile().get(0)));
ed.getType().get(0).getProfile().get(0).getValueAsString();
String urlValue = ed.getType().get(0).getProfile().get(0).toString();
Copy link
Contributor

Choose a reason for hiding this comment

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

This is set, but never used

Copy link
Contributor

Choose a reason for hiding this comment

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

Applied

tooling/pom.xml Outdated
@@ -333,6 +333,12 @@
<artifactId>mockserver-client-java</artifactId>
<version>5.14.0</version>
</dependency>
<dependency>
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't notice where this dependency is being used in this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Applied

@c-schuler c-schuler self-requested a review August 19, 2024 21:40
Copy link
Contributor

@c-schuler c-schuler left a comment

Choose a reason for hiding this comment

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

Looks good! Waiting on @brynrhodes to give the final go-ahead.

@brynrhodes brynrhodes merged commit 6dd2f5c into master Aug 20, 2024
4 checks passed
@brynrhodes brynrhodes deleted the issue-443-race-ethnicity-to-spreadsheet branch August 20, 2024 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants