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

UHM-7475, configure person relationships widget with a specific type #129

Merged
merged 5 commits into from
Oct 21, 2023

Conversation

cioan
Copy link
Member

@cioan cioan commented Oct 18, 2023

No description provided.

limit: 10,
q: request.term,
v: 'custom:(id,uuid,display,gender,age)'
}, function (result) {
Copy link
Member

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?

Copy link
Member

@mseaton mseaton left a 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{
Copy link
Member

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 {
Copy link
Member

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.

Copy link
Member

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?

Copy link
Member

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...

Copy link
Member

@mogoodrich mogoodrich left a 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;
Copy link
Member

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;
Copy link
Member

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)

@cioan
Copy link
Member Author

cioan commented Oct 18, 2023

Thank you @mseaton and @mogoodrich ! I have implemented the gender filtering:
Screenshot 2023-10-18 at 10 17 23 AM

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.

@cioan
Copy link
Member Author

cioan commented Oct 19, 2023

I have updated the widget so the direction of the relationship could be configured. And, therefore, now we are able to configure the widget to record a child of the patient:
Screenshot 2023-10-19 at 9 33 18 AM
Screenshot 2023-10-19 at 9 34 28 AM

Screenshot 2023-10-19 at 9 35 03 AM

@cioan
Copy link
Member Author

cioan commented Oct 20, 2023

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:
Screenshot 2023-10-20 at 9 14 32 AM
Screenshot 2023-10-20 at 9 15 02 AM

Screenshot 2023-10-20 at 9 16 34 AM

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.

@mseaton
Copy link
Member

mseaton commented Oct 20, 2023

Screenshots look great to me @cioan !

@cioan
Copy link
Member Author

cioan commented Oct 21, 2023

Thanks @mseaton ! I am going to merge in all those pending PRs so they have time to propagate to test servers over the weekend.

@cioan cioan merged commit d779b28 into master Oct 21, 2023
1 check passed
@cioan cioan deleted the UHM-7475 branch October 24, 2023 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants