# Display secondary identifiers across the app (and in particular on the clinical patients and dashboard screens)

**URL:** <https://talk.openmrs.org/t/display-secondary-identifiers-across-the-app-and-in-particular-on-the-clinical-patients-and-dashboard-screens/16676>\
**Category:** Bahmni\
**Tags:** patientidentifier, patient-dashboard\
**Created:** [March 9, 2018, 3:37am UTC](https://talk.openmrs.org/t/display-secondary-identifiers-across-the-app-and-in-particular-on-the-clinical-patients-and-dashboard-screens/16676 "2018-03-09T03:37:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ouiliam](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ouiliam/32/6415_2.png) [@ouiliam](https://talk.openmrs.org/u/ouiliam)\
**Post date:** [March 9, 2018, 3:37am UTC](https://talk.openmrs.org/t/display-secondary-identifiers-across-the-app-and-in-particular-on-the-clinical-patients-and-dashboard-screens/16676/1 "2018-03-09T03:37:38Z")

</div>

I have looked in clinical/app.json and dashboard.json, but am not sure of the exact name of the manually entered patientidentifierattribute (“Legacy ID” in our config) we should use, or where to put it.

---

<div class="post-metadata">

**Author:** ![sruti](https://talk.openmrs.org/letter_avatar/sruti/32/5_5575768a8748004e209b776fc1b2916d.png) [@sruti](https://talk.openmrs.org/u/sruti)\
**Post date:** [March 9, 2018, 5:29am UTC](https://talk.openmrs.org/t/display-secondary-identifiers-across-the-app-and-in-particular-on-the-clinical-patients-and-dashboard-screens/16676/2 "2018-03-09T05:29:44Z")

</div>

Hi @ouiliam, What do you mean by a Legacy ID - The patient Identifier or some other secondary identifier?

---

<div class="post-metadata">

**Author:** ![ouiliam](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ouiliam/32/6415_2.png) [@ouiliam](https://talk.openmrs.org/u/ouiliam)\
**Post date:** [March 9, 2018, 9:27am UTC](https://talk.openmrs.org/t/display-secondary-identifiers-across-the-app-and-in-particular-on-the-clinical-patients-and-dashboard-screens/16676/3 "2018-03-09T09:27:29Z")

</div>

A secondary identifier, we’d like to make it our preferred identifier too, could only find documentation [https://bahmni.atlassian.net/wiki/spaces/BAH/pages/114227194/Patient+Context+Display+Control](https://bahmni.atlassian.net/wiki/spaces/BAH/pages/114227194/Patient+Context+Display+Control) on where/how to enter it in the following clinical config:

apps.json:

```
      "personAttributes": [
      ],
      "additionalPatientIdentifiers": [
      ],
      "preferredIdentifier": "Id_Number"

```

dashboard.json

```
            "patientInformation":{
            "type":"patientInformation",
            "patientAttributes":[
       
            ],
            "addressFields":[
                "cityVillage",
                "countyDistrict",
                "stateProvince"
            ]
        },
```

---

<div class="post-metadata">

**Author:** ![ouiliam](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ouiliam/32/6415_2.png) [@ouiliam](https://talk.openmrs.org/u/ouiliam)\
**Post date:** [March 9, 2018, 12:17pm UTC](https://talk.openmrs.org/t/display-secondary-identifiers-across-the-app-and-in-particular-on-the-clinical-patients-and-dashboard-screens/16676/4 "2018-03-09T12:17:08Z")

</div>

“Legacy ID” is the name of the Patient Identifier Type we want to use:

![image](https://talk.openmrs.org/uploads/default/original/2X/2/2c3a5b7b736a1289b772eb48781ad307f97eaed4.png)

---

<div class="post-metadata">

**Author:** ![ouiliam](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ouiliam/32/6415_2.png) [@ouiliam](https://talk.openmrs.org/u/ouiliam)\
**Post date:** [March 9, 2018, 12:47pm UTC](https://talk.openmrs.org/t/display-secondary-identifiers-across-the-app-and-in-particular-on-the-clinical-patients-and-dashboard-screens/16676/5 "2018-03-09T12:47:22Z")

</div>

after trying many combinations, i could get the secondary identifier to display in dashboard (MK1233) by changing app.json only (additionalPatientIdentifiers entry):

![image](https://talk.openmrs.org/uploads/default/original/2X/9/91498244f2ec70b619469f6aca2c1fc05b9eb4af.png)

but the clinical patients screen still only shows openmrs ID ☹

```
    "patientContext": {
      "programAttributes": [

      ],
      "personAttributes": [
      ],
      "additionalPatientIdentifiers": [
        "impl.legacyId"
      ],
      "preferredIdentifier": 
  },

```

![image](https://talk.openmrs.org/uploads/default/original/2X/5/54e6afa961d1ab0169fd4d2d6400e57864383507.png)

---

<div class="post-metadata">

**Author:** ![ouiliam](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ouiliam/32/6415_2.png) [@ouiliam](https://talk.openmrs.org/u/ouiliam)\
**Post date:** [March 9, 2018, 12:52pm UTC](https://talk.openmrs.org/t/display-secondary-identifiers-across-the-app-and-in-particular-on-the-clinical-patients-and-dashboard-screens/16676/6 "2018-03-09T12:52:29Z")

</div>

not sure if i also need to do this [https://wiki.openmrs.org/display/docs/Registration+App+Configuration#RegistrationAppConfiguration-CollectingAdditionalPatientIdentifiersintheRegistrationApp](https://wiki.openmrs.org/display/docs/Registration+App+Configuration#RegistrationAppConfiguration-CollectingAdditionalPatientIdentifiersintheRegistrationApp)

---

<div class="post-metadata">

**Author:** ![binduak](https://talk.openmrs.org/letter_avatar/binduak/32/5_5575768a8748004e209b776fc1b2916d.png) [@binduak](https://talk.openmrs.org/u/binduak)\
**Post date:** [March 12, 2018, 5:22am UTC](https://talk.openmrs.org/t/display-secondary-identifiers-across-the-app-and-in-particular-on-the-clinical-patients-and-dashboard-screens/16676/7 "2018-03-12T05:22:26Z")

</div>

Hi @ouiliam, We always show primary identifier in the patient queues. You can either

- Change **bahmni.primaryIdentifierType** global property pointing to secondary identifier. That will show your impl.legacyId in patient queues instead of patient identifier.
- Show the **list view** instead of tiles view in clinical queue as mentioned in end-tb [demo](https://demo-tb.mybahmni.org/bahmni/clinical/#/default/patient/search) (credentials: superman/Admin123) . This will show both the identifier values. Hope this helps.

---

<div class="post-metadata">

**Author:** ![ouiliam](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ouiliam/32/6415_2.png) [@ouiliam](https://talk.openmrs.org/u/ouiliam)\
**Post date:** [March 13, 2018, 10:19am UTC](https://talk.openmrs.org/t/display-secondary-identifiers-across-the-app-and-in-particular-on-the-clinical-patients-and-dashboard-screens/16676/8 "2018-03-13T10:19:11Z")

</div>

Thank you very much for your suggestions @binduak, I am using the list view option (in extension.json just add “view”:“tabular”, to relevant section [https://bahmni.atlassian.net/wiki/spaces/BAH/pages/32014629/Configure+Patient+Lists+Queues](https://bahmni.atlassian.net/wiki/spaces/BAH/pages/32014629/Configure+Patient+Lists+Queues)) but am unsure how to change the SQL query to return the secondary identifier (Legacy ID) as well as the primary one (patient\_identifier.identifier) for the list columns, the demo you provided does not seem to do this? ![image](https://talk.openmrs.org/uploads/default/original/2X/6/67f61a7a8720b8cbf39048fada30c7c594de5b0f.png)

emrapi.sqlSearch.activePatients from OpenMRS administration → advanced settings

```
select distinct
      concat(pn.given_name,' ', ifnull(pn.family_name,'')) as name,
      pi.identifier as identifier,
      concat("",p.uuid) as uuid,
      concat("",v.uuid) as activeVisitUuid,
      IF(va.value_reference = "Admitted", "true", "false") as hasBeenAdmitted
    from visit v
    join person_name pn on v.patient_id = pn.person_id and pn.voided = 0
    join patient_identifier pi on v.patient_id = pi.patient_id
    join patient_identifier_type pit on pi.identifier_type = pit.patient_identifier_type_id
    join global_property gp on gp.property="bahmni.primaryIdentifierType" and gp.property_value=pit.uuid
    join person p on p.person_id = v.patient_id
    join location l on l.uuid = ${visit_location_uuid} and v.location_id = l.location_id
    left outer join visit_attribute va on va.visit_id = v.visit_id and va.attribute_type_id = (
      select visit_attribute_type_id from visit_attribute_type where name="Admission Status"
    ) and va.voided = 0
    where v.date_stopped is null AND v.voided = 0

```
