Xfoms pull data from Address Template.

Hello,

I’m using OpenMRS 1.9 and I’m trying to create a Xforms and OpenMRS Address Template. I want to pull data that’s saved onto the Address Template when creating a patient to the XForms automatically, so I can avoid reentering the same Data.

But I can’t find a way to get this value: "property name=“country” value=“Location.country” from the template to xforms design schema.

Any ideas?

Thanks

Can you try reproduce it here? int-refapp.openmrs.org That way we shall be looking at the same server and i will hence be in a better position to guide you.

Hello I can’t access the server, what is the user and pass?

But i will add some pictures,

1-the first picture will be a picture of the patient create form, on which you can see the info the system registers: Example: Given Name, Middle Name, Family name, etc… the field I’m interested in is the Country field on the address part.

2-The second image is an Image of the Patient Form Schema created on Xforms, what I would want to do is create a field with the infor saved on Image 1, esecifically country so It can be pulled from the data already entered onto the system.

3-The third image is what The Xforms patient sheet looks like, as you can see , it pulls the information from the first first image, the patient creation form automatically to the patient field. I would like to have a field on the Xforms patient sheet on that pulls the data from the patient creation form automatically, like it does with the fields Given Name, MIddle Name, Sex, Birthdate, Encounter Date.

thank you.

The username is: admin Password is: Admin123

Hello,

I created a patient called :Country test, and a form Country of Origin, in which I created a form field called: Location.Country which is a database element with table:location and attribute:country and included it on the Encounter section of the schema.

So the idea is this field would work similar to the fields inside the paitient and encounter sections and pull the data from the tables.

Ok,

so apparently the info i want to pull is on the person_address table, on attribute:country, I create another form field. With database element, table:person_address and attribute:country, yet still it appears blank.

For person_address.country, on the form schema screen where you select Field Type as Database Element, set the default value to: $!{patient.getPersonAddress().getCountry()}

As for location.country, what do you want to display here? Location of the logged on user? Or something else?

Thank you the first one is the answer I was looking for. The other one I created, as I was a little confused on which table the data was stored.

Thank you once again @dkayiwa