Hi,
I have implemented a fragment to customize the Patient Registration Form. The fragment code is given below,
locationbasedaccess/locations.gsp
<div>
<div>
<p class="left">
<label>
Please select the default access location
</label>
<select id="${config.formFieldName}" name="${config.formFieldName}" class="rel_type">
<% activeLocations.each { location -> %>
<option value="${location.uuid}">${location.name}</option>
<% } %>
</select>
</p>
</div>
</div>
locationbasedaccess/LocationsFragmentController
public class LocationsFragmentController {
public void controller(FragmentModel model) {
model.addAttribute("activeLocations", Context.getLocationService().getAllLocations(true));
}
}
Then I have created an App Definition like this follow,
{
"legend": "Patient Location ",
"id": "patientLocationLabel",
"fields": [
{
"type": "personAttribute",
"label": "Select Location",
"formFieldName": "locationId",
"uuid": "76f86917-9edb-4258-b9d7-51c889606a3c",
"widget": {
"providerName": "locationbasedaccess",
"fragmentId": "field/locations"
}
}
]
}
Here I have already created this personAttribute in the OpenMRS system and replaced the uuid respect to that personAttribute.
When I used these following widget(in the above App Definition),
"widget": {
"providerName": "uicommons",
"fragmentId": "field/text"
}
}
I was able to get the value entered in the text box as a personAttribute using AOP Service ( by tracking the savePerson() method)
But I couldn’t get the value entered in the Patient Registration form through the AOP service as personAttribute (by tracking the savePerson() method)
"widget": {
"providerName": "locationbasedaccess",
"fragmentId": "field/locations"
}
}
Here I need to get the value which is selected in the patient registration form by user as PersonAttribute
Can some one please help me to solve this issue?