body{font-size:10pt;font-family:arial,sans-serif;background-color:#ffffff;color:black;}p{margin:0px;}Also, getDisplayString is a method of the ConceptResource, not Concept.-----Original Message-----
From: Darius Jazayeri Sent: Oct 3, 2013 10:14 AM
To: "openmrs/openmrs-module-webservices.rest" Subject: Re: [openmrs-module-webservices.rest] Display string of a person attribute of type concept  (#55)

In omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/PersonAttributeResource1_8.java:
> @@ -172,7 +173,10 @@ public void purge(PersonAttribute delegate, RequestContext context) throws Respo
>  	public String getDisplayString(PersonAttribute pa) {
>  		if (pa.getAttributeType() == null)
>  			return "";
> -		
> +	if (Concept.class.getName().equals(pa.getAttributeType().getFormat()) && pa.getValue() != null) {
> +		Concept concept = Context.getConceptService().getConcept(pa.getValue());
> +		return concept == null ? null : concept.getDisplayString();

This changes the behavior so that you're no longer displaying it like "name = value". It should return pa.getAttributeType().getName() + " = " + concept.getDisplayString() or something like that.

—Reply to this email directly or view it on GitHub.