Changes to be made to the API, so as to still support the existing contract while modifying the response to include the result in user specified locale

Description

When concepts are fetched by FSN, the api

/openmrs/ws/rest/v1/concept?s=byFullySpecifiedName

should also return a list of “names” which will be the union of all types (i.e FSN, Short Name, etc) for the current user’s logged in locale and the default locale setup for the system.

Example: Consider that the concept “Consultation Note” has short name and FSN in English as well as Spanish and French

Name type

English

Spanish

French

Short Name

Consultation Note SN in En

Consultation Note SN in Es

Consultation Note SN in Fr

Fully Specified Name

Consultation Note FSN in En

Consultation Note FSN in Es

Consultation Note FSN in Fr

If the system locale is Fr and the user has logged in with Es,

Request: openmrs/ws/rest/v1/concept?s=byFullySpecifiedName&name=Consultation Note&v=custom: (uuid,name,names,set,setMembers: (uuid,display,name: (uuid,name),names,retired))

results.name → “Consultation Note FSN in Fr” (name in Fr)

results.names → [ { name: “Consultation Note FSN in Fr”, conceptNameType: “FULLY_SPECIFIED”, locale: fr},

{ name: “Consultation Note SN in Fr”, conceptNameType: “SHORT, locale: fr},

{ name: “Consultation Note FSN in Es”, conceptNameType: “FULLY_SPECIFIED”, locale: es},

{ name: “Consultation Note SN in Es”, conceptNameType: “SHORT”, locale: es}]

The setMembers on the resultant concept should also expose similar names field

The UI can then filter out the name that needs to be displayed.

Assignee

Praveena Dayanand

Reporter

Swetha Bachugudem

Labels

None

Units

None

PercentDone

None

DueTime

None

Clients

None

External issue ID

None

UAT Assignee

None

Reviewer

None

Sprint

Configure