Demo Registration App is switching given and family names in confirmation screen (dataCanvas)

Hi,

I just registered a new patient demo.openmrs.org and noticed that the given and family names aren’t in the right place on the confirmation screen. Name Entry Screen:

Confirmation Screen:

The comma in the name suggests that the order is familyName, givenName, but as you can see, it’s givenName, familyName. It looks like the name is added incorrectly to the dataCanvas in the JavaScript.

Craig

Nice catch. Can you create an issue for this in the RA project in JIRA?

Thanks @darius, I created RA-1352

I propose that we just get rid of the comma and not change the order

@wyclif The order that the names are displayed should match the order that they are entered - never run into problems with it but the principle has to be enforced

I think this is hinting that we probably need to use the name template in the RA, different areas in the world have different name ordering, I’m sure an American would prefer the current order in the summary regardless of the order on the form and in Uganda one would prefer the last name (surname) first on both the form and summary. So how about we use the name template in the RA?

As far as I can tell from a quick glance at the code, we do use name templates in the registrationapp module for new registrations, editing name details, and displaying a registration summary. However, I think ( and @mogoodrich / @cioan / @darius or others would know better ), the confirmation dialog that is displayed does not use this. This may be a result of how the navigator.js library that is included in uicommons works.

Mike

Thanks for adding me @mseaton, I wasn’t watching this closely enough!

Mike correct, the issue is that we are not passing in information to the navigator model as to how to render the name… we should pass this in via a “display-template” attribute, and create that template based on the address template.

The display template is set up in the navigator model here:

Unfortunately, the display-template is not at all documented nor easy to figure out. I’d need to do a little work to figure it out. I’m willing to work on it, but probably won’t get to it for at least a couple days… if no one else want to take it on,let me know and I’ll pick it up.

Take care, Mark