-
Notifications
You must be signed in to change notification settings - Fork 111
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
FM2-276: Add create, update and delete methods for RelatedPerson #317
base: master
Are you sure you want to change the base?
Conversation
Bump lombok to 1.18.16
Codecov Report
@@ Coverage Diff @@
## master #317 +/- ##
============================================
+ Coverage 80.76% 80.86% +0.10%
- Complexity 2258 2275 +17
============================================
Files 206 206
Lines 6046 6088 +42
Branches 710 719 +9
============================================
+ Hits 4883 4923 +40
+ Misses 744 743 -1
- Partials 419 422 +3
Continue to review full report at Codecov.
|
@ibacher @varung-31 I've made the changes and added the methods for RelatedPerson. PTAL |
@theanandankit I don't want to discourage you and thanks for your work on this, but the real challenge here is figuring out how to map a FHIR relationship back into OpenMRS in a sensible way. If you look at the translator, trying to create or update a relationship will just result in an exception. The reason is that OpenMRS |
@ibacher thank you for the review, I've added the translator for RelatedPerson to OpenMRS. am I still missing something or it's okay? PTAL |
api/src/main/java/org/openmrs/module/fhir2/providers/r3/RelatedPersonFhirResourceProvider.java
Show resolved
Hide resolved
@ibacher I've added tests. PTAL |
@ibacher can we merge this PR? |
@@ -110,6 +113,42 @@ public RelatedPerson toFhirResource(@Nonnull Relationship relationship) { | |||
|
|||
@Override | |||
public Relationship toOpenmrsType(@Nonnull RelatedPerson resource) { | |||
throw new UnsupportedOperationException(); | |||
Relationship relationship = new Relationship(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't always generate a new relationship... there needs to be some allowance for updating an existing relationship, right? So I think we need to change RelatedPersonTranslator
to extend UpdatableOpenmrsTranslator
. Likewise personA
should be retrieved from the database, if at all possible... Honestly, I think that's the really hard part about this....
Description of what I changed
Issue I worked on
see https://issues.openmrs.org/browse/FM2-276
Checklist: I completed these to help reviewers :)
My IDE is configured to follow the code style of this project.
No? Unsure? -> configure your IDE, format the code and add the changes with
git add . && git commit --amend
I have added tests to cover my changes. (If you refactored
existing code that was well tested you do not have to add tests)
No? -> write tests and add them to this commit
git add . && git commit --amend
I ran
mvn clean package
right before creating this pull request andadded all formatting changes to my commit.
No? -> execute above command
All new and existing tests passed.
No? -> figure out why and add the fix to your commit. It is your responsibility to make sure your code works.
My pull request is based on the latest changes of the master branch.
No? Unsure? -> execute command
git pull --rebase upstream master