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

Support for multiple FHIR profile extensions #986

Merged
merged 8 commits into from
Apr 12, 2024

Conversation

chandrashekar-s
Copy link
Collaborator

@chandrashekar-s chandrashekar-s commented Mar 14, 2024

Description of what I changed

Fixes #980

This is an extension to the PR #924. In this PR we provide support for multiple FHIR profile extension for a given resource type. This is achieved by creating a Master AvroConverter for the given resource type by merging all the individual AvroConverters against the configured extensions profiles including the base profile. The merging includes a deep merge of the nested elements under the AvroConverter.

E2E test

Tested the changes with the default US Core FHIR profile extensions and verified that the extension fields are properly populated in the parquet files.

TESTED:

Please replace this with a description of how you tested your PR beyond the
automated e2e/unit tests.

Checklist: I completed these to help reviewers :)

  • I have read and will follow the review process.

  • I am familiar with Google Style Guides for the language I have coded in.

    No? Please take some time and review Java and Python style guides.

  • My IDE is configured to follow the Google code styles.

    No? Unsure? -> configure your IDE.

  • I have added tests to cover my changes. (If you refactored existing code that was well tested you do not have to add tests)

  • I ran mvn clean package right before creating this pull request and added all formatting changes to my commit.

  • All new and existing tests passed.

  • My pull request is based on the latest changes of the master branch.

    No? Unsure? -> execute command git pull --rebase upstream master

@codecov-commenter
Copy link

codecov-commenter commented Mar 14, 2024

Codecov Report

Attention: Patch coverage is 59.20578% with 113 lines in your changes are missing coverage. Please review.

Project coverage is 50.52%. Comparing base (b354beb) to head (178366b).

Files Patch % Lines
...r/bunsen/avro/tools/GenerateAggregatedSchemas.java 0.00% 55 Missing ⚠️
...unsen/avro/converters/DefinitionToAvroVisitor.java 88.18% 9 Missing and 4 partials ⚠️
.../cerner/bunsen/definitions/PrimitiveConverter.java 38.46% 6 Missing and 2 partials ⚠️
...m/cerner/bunsen/definitions/HapiConverterUtil.java 12.50% 5 Missing and 2 partials ⚠️
...ner/bunsen/definitions/LeafExtensionConverter.java 40.00% 3 Missing and 3 partials ⚠️
.../com/cerner/bunsen/avro/tools/GenerateSchemas.java 44.44% 4 Missing and 1 partial ⚠️
.../com/google/fhir/analytics/AvroConversionUtil.java 44.44% 4 Missing and 1 partial ⚠️
...java/com/cerner/bunsen/ProfileMappingProvider.java 66.66% 3 Missing ⚠️
...m/cerner/bunsen/avro/converters/NoOpConverter.java 0.00% 2 Missing ⚠️
...a/com/cerner/bunsen/ProfileMapperFhirContexts.java 50.00% 2 Missing ⚠️
... and 6 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #986      +/-   ##
============================================
+ Coverage     50.36%   50.52%   +0.16%     
- Complexity      644      663      +19     
============================================
  Files            87       91       +4     
  Lines          5266     5465     +199     
  Branches        669      701      +32     
============================================
+ Hits           2652     2761     +109     
- Misses         2366     2444      +78     
- Partials        248      260      +12     

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

@chandrashekar-s
Copy link
Collaborator Author

@bashir2 The PR is ready for the first round of review, can you please have a look and let me know if the approach taken is good. In the meanwhile, I will add unit tests.

Copy link
Collaborator

@bashir2 bashir2 left a comment

Choose a reason for hiding this comment

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

Thanks @chandrashekar-s for the changes. I think this is a nice solution for the multiple extension issue and I like the merge() idea. I am sharing my first batch of comments. I have not yet finished my first pass and may share another batch later today, if I can (otherwise tomorrow).

@chandrashekar-s chandrashekar-s force-pushed the merge-fhir-profiles branch 3 times, most recently from 02d314b to ba495b9 Compare March 26, 2024 11:06
Copy link
Collaborator Author

@chandrashekar-s chandrashekar-s left a comment

Choose a reason for hiding this comment

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

Thanks for the review @bashir2. In the latest commits, I have added more unit tests and have addressed your comments.

@chandrashekar-s
Copy link
Collaborator Author

@bashir2 Please have a look at the latest commits containing more unit tests and some minor fixes.

Copy link
Collaborator

@bashir2 bashir2 left a comment

Choose a reason for hiding this comment

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

Thanks @chandrashekar-s for the changes. Most of my comments are minor and I think we can close this PR this week. Beside the comments below, there is also one unresolved comment about ParquetMerger which I cannot reply to anymore (I guess because you have force pushed over an old commit); it is about the experiments you did with compatible but different schemas (e.g., when a new extension is added). Can you please document your finding somewhere? Even if it is in a javadoc that is fine, but it would be nice to have a record of that.

@chandrashekar-s
Copy link
Collaborator Author

Thanks @bashir2 for the detailed review. I have addressed most of the comments, there are only 2 comments left which we can discuss in our tomorrow's meeting.

Copy link
Collaborator

@bashir2 bashir2 left a comment

Choose a reason for hiding this comment

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

Thanks @chandrashekar-s for the changes; all remaining comments are minor and/or we discussed them. So please feel free to merge this once they are resolved.

Copy link
Collaborator Author

@chandrashekar-s chandrashekar-s left a comment

Choose a reason for hiding this comment

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

Thanks @bashir2 for the review. I have addressed the comments in the latest commits. I will be merging the changes. Please let me know if there are any concerns.

@chandrashekar-s chandrashekar-s merged commit b07b3ec into google:master Apr 12, 2024
6 checks passed
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.

Create a generic solution for supporting multiple extensions for same resource type
3 participants