Coded patient attributes showing up with fully qualified name on patient dashboard

It seems like coded patient attributes, when included in the patient dashboard are shown with their fully qualified names instead of their short names. Is this a known issue?

Bahmni version 0.91.

Moved to the bahmni category.

Anyone has an idea about this?

AFAIK, Reg app never had such means, also unlike in clinical app config registration app, does not have any such config. You may introduce a config element in reg and also implement the display.

Hi @angshuonline @ramses

The following are the two approaches which I think should be followed for this:

  1. Change in API from Bahmni Core

As the API throws fully specified name of coded person attributes, we can add a constraint to first check for short name. If the value is null then pick fully specified name.

  1. Referring the person attribute service from Registration module to Clinical module.

According to me, the first approach is better even if the change has to be made in the core. Using such an approach the earlier functionality will also not be disturbed whereas, in the 2nd approach, there is static change .

Thoughts ?

we should be consistent in our API responses. API must return also concept “names”, specific to user local/application local. I think the API should return all the names (application default locale & user logged in locale) and all the names (FSN, short, synonyms) and the frontend should make the decision (based on configuration whether to show FSN or SHORT, or by default show SHORT unless specified so).

In our relevant work around localization, we are taking the following approach:

  1. return all names (application locale and logged in user locale)
  2. a function on the frontend filters out and picks up the right name
  • filter out name for the logged in context locale. if names are not found, then pick the names for the application locale
  • by default pick up the “SHORT” name, unless a function parameter specifies different (FSN or otherwise)

@praveenad ^

The above mentioned issue has been overcome by making the changes to the REST API of openmrs core.This API was bringing only fully specified names for coded person attributes.

I have added the constraint for also sending short name in the REST API. Below mentioned is the file path and the code.

openmrs-module-webservices.rest/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ PersonAttributeResource1_8.java

On line number 296 and configured the resultant value on UI.

      @PropertyGetter("display")
     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());
		ConceptName name = concept.getShortNameInLocale(Locale.ENGLISH);
		String displayShortName = name == null ? concept.getDisplayString() : name.getName();
		return concept == null ? null : displayShortName;
	}
	return pa.getAttributeType().getName() + " = " + pa.getValue();
}

@angshuonline Please review so that I can raise a PR.