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

Super class field mapping Resource Extraction #954

Merged
merged 13 commits into from
Dec 28, 2021
Merged

Conversation

maimoonak
Copy link
Collaborator

Fixes #943

Description
Resource Extraction by Field allows mapping for parent class fields like DomainResource field extension for Patient class

Alternative(s) considered
The class just needed additional handling to traverse super class when Field not found in current class mapped

Type
Choose one: Bug fix

Checklist

  • I have read and acknowledged the Code of conduct
  • I have read How to Contribute
  • I have read the Developer's guide
  • I have signed the Google Individual CLA, or I am covered by my company's Corporate CLA
  • I have discussed my proposed solution with code owners in the linked issue(s) and we have agreed upon the general approach
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the style guide of this project
  • I have run ./gradlew check and ./gradlew connectedCheck to test my changes locally
  • I have built and run the reference app(s) to verify my change fixes the issue and/or does not break the reference app(s)

@codecov
Copy link

codecov bot commented Dec 6, 2021

Codecov Report

Merging #954 (1c8c391) into master (7c36626) will increase coverage by 0.03%.
The diff coverage is 88.88%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #954      +/-   ##
============================================
+ Coverage     88.40%   88.43%   +0.03%     
  Complexity      498      498              
============================================
  Files           112      112              
  Lines          9355     9362       +7     
  Branches        637      638       +1     
============================================
+ Hits           8270     8279       +9     
+ Misses          751      748       -3     
- Partials        334      335       +1     
Impacted Files Coverage Δ
...android/fhir/datacapture/mapping/ResourceMapper.kt 82.69% <88.88%> (+1.59%) ⬆️
...va/com/google/android/fhir/db/impl/DatabaseImpl.kt 90.12% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7c36626...1c8c391. Read the comment docs.

@Tarun-Bhardwaj
Copy link

@aditya-07 , could you please review this PR?

@maimoonak
Copy link
Collaborator Author

@Tarun-Bhardwaj @aditya-07 I have fixed the failing CI issue

@maimoonak
Copy link
Collaborator Author

@aditya-07 feedback resolved.

…mapping/ResourceMapper.kt

Co-authored-by: Aditya Kurkure <[email protected]>
Copy link
Collaborator

@aditya-07 aditya-07 left a comment

Choose a reason for hiding this comment

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

Great PR @maimoonak! LGTM!

@maimoonak maimoonak merged commit e64d363 into master Dec 28, 2021
@maimoonak maimoonak deleted the 943_res_extr_super_fld branch December 28, 2021 07:25
@jingtang10
Copy link
Collaborator

@maimoonak @aditya-07: Looking through this code, I understand that the change you made is making sure a latter value is not overriding an earlier value if you're setting the same field (which is a list).

So I'm not sure the title of this PR is accurate - can you confirm? and if so can you update the title and description?

thanks

@maimoonak
Copy link
Collaborator Author

@jingtang10 The main aim of PR as to allow mapping fields into superclass. For example with
Patient->DomainResource->Resource
code did not allow to map tag OR extension fields into superlcass to be mapped into SDC-extraction. This PR fixes it by line.
Other issue which was noticed when mapping extension was that incase of multiple mapping it was always overriding first value of extension hence only last mapped extension persisted.

The issue that was fixed into PR was 'Allow super class field mapping for SDC Resource Extraction'

@jingtang10
Copy link
Collaborator

thanks @maimoonak - as long as this is documented in this issue it's fine. if you can just list the two things this PR does in the description that'd be great. thanks!

@jingtang10
Copy link
Collaborator

But perhaps a good follow-up PR to write is to provide minimal test cases. I think your new test case is too big and testing both of the things this PR is doing.

@maimoonak
Copy link
Collaborator Author

Ok. Sure would break it down into two separate cases for each functionality separately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Handle inherited properties of Resource into questionnaire when doing extraction via ResourceMapper
5 participants