-
Notifications
You must be signed in to change notification settings - Fork 133
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
UHM-7475, configure person relationships widget with a specific type #129
Conversation
limit: 10, | ||
q: request.term, | ||
v: 'custom:(id,uuid,display,gender,age)' | ||
}, function (result) { |
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.
It looks to me like you are configuring this widget with a gender
property, but I don't see where you are actually limiting the results to persons that match this gender. Shouldn't that be done in a filter here?
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.
Overall looks fine to me, would be good to see a screenshot / animated gif that demonstrates what this looks like. A few small comments to address.
|
||
import org.codehaus.jackson.annotate.JsonProperty; | ||
|
||
public class RegisterPersonRelationshipWidget extends Widget{ |
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.
Nitpick, but if you can run a formatter on this file to clean up the spacing before/after curly braces, between methods, between properties, etc that would be good. It seems a bit inconsistent.
this.config = config; | ||
} | ||
|
||
public static class Config { |
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.
See my comments on the pihcore PR. Basically, let's make this a top-level class named PersonRelationshipConfig
and also add the label
property you have on the config in the other PR.
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.
@mseaton I would think it makes sense to keep this like it is, because it follows the existing pattern used for the other widgets? Or am I missing something?
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.
Ok, fine if that's what we've done...
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.
Thanks @cioan ! Looks like the right approach to me. Agree with Mike about gender, but assume that this is because this is a work-in-progress and hasn't been implemented.
I'm guessing the "type" property is to specific whether it is an "a_is_to_b" or "b_is_to_a" relationship, which we will need when specifying whether you are selecting the "Parent' or "Child" in a "Parent/Child" relationship.
But, yes, looks like the right approach in general!
|
||
public static class Config { | ||
@JsonProperty | ||
private String type; |
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.
What does type property refer to?
private String relationshipType; | ||
|
||
@JsonProperty | ||
private String gender; |
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.
this limits the people returns by gender, if specified? (makes sense, as long as null is allowed, just clarifying)
Thank you @mseaton and @mogoodrich ! I have implemented the gender filtering: I also removed the "type" property and reformatted the code. I kept the inner Config class per @mogoodrich comment that this is the current pattern implemented for all the other widgets. Please let me know if you would like to discuss this further. |
Hi @mseaton and @mogoodrich , in the latest commit, I added the capability to record multiple relationships of the same type by leveraging the "multipleValues" configuration property: Please let me know what you think. I still need to implement the removeRelationship function and to figure out the display Template for the Confirm page. But now, we are able to record multiple children of a patient using the registration form. |
Screenshots look great to me @cioan ! |
Thanks @mseaton ! I am going to merge in all those pending PRs so they have time to propagate to test servers over the weekend. |
No description provided.