teleivo
(Ivo Ulrich)
June 12, 2016, 9:19am
1
Hi there!
does anybody have an idea how I could get the UUID instead of the patient ID using the openmrs:fieldGen
of type Patient?
When looking at:
<%@ include file="/WEB-INF/view/module/legacyui/template/include.jsp" %>
<%@ attribute name="formFieldName" required="true" %>
<%@ attribute name="formFieldId" required="false" %>
<%@ attribute name="searchLabel" required="false" %> <%-- deprecated --%>
<%@ attribute name="searchLabelCode" required="false" %> <%-- deprecated --%>
<%@ attribute name="searchLabelArguments" required="false" %> <%-- deprecated --%>
<%@ attribute name="initialValue" required="false" %> <%-- This should be a patientId --%>
<%@ attribute name="linkUrl" required="false" %> <%-- deprecated --%>
<%@ attribute name="callback" required="false" %> <%-- gets the relType, PatientListItem sent back --%>
<%@ attribute name="allowSearch" required="false" %> <%-- deprecated --%>
<openmrs:htmlInclude file="/dwr/interface/DWRPatientService.js" />
<openmrs:htmlInclude file="/scripts/jquery/autocomplete/OpenmrsAutoComplete.js" />
<openmrs:htmlInclude file="/scripts/jquery/autocomplete/jquery.ui.autocomplete.autoSelect.js" />
<c:if test="${empty formFieldId}">
<c:set var="formFieldId" value="${formFieldName}_id" />
</c:if>
<c:set var="displayNameInputId" value="${formFieldId}_selection" />
This file has been truncated. show original
I dont see how, my only thought is to create my own custom patientField.tag where I replace ui.item.object.patientId
with ui.item.object.uuid
The reason why I need this is that I am now using REST to populate my datatables in the legacyui and need the patients UUID as a param.
teleivo
(Ivo Ulrich)
June 12, 2016, 12:24pm
2
I am trying to create a custom patientUuidField.tag
which uses value ui.item.object.uuid
How do I use this field tag then?
I tried setting the url
in
<openmrs:fieldGen type="org.openmrs.Patient"
formFieldName="patientQuery" url="patientUuid.field" />
but that didnt work out. Not sure if this is because I am in a module, so I need a prefix to the url for it to find my custom field (it currently lives under omod/src/main/webapp/tags/patientUuidField.tag
) or do I also need to write a FieldGenHandler ?
Thanks a lot for any hints
dkayiwa
(Daniel Kayiwa)
June 12, 2016, 6:43pm
3
1 Like
teleivo
(Ivo Ulrich)
June 12, 2016, 8:13pm
4
spot on! just what I needed
thank you soo much!
can you tell me what the difference is between a “normal” tag and a field gen?
dkayiwa
(Daniel Kayiwa)
June 12, 2016, 8:41pm
5
teleivo
(Ivo Ulrich)
June 13, 2016, 7:49am
6
thanks for the extensive explanation and your help!!