Managing Patients Locations

On registering a patient, how can i switch the patient location so that they appear in a particular location that is already existing?..@matirp235…I will appreciate any guidance. Thanks.

1 Like

Moved to the bahmni category.

What do you mean sir…!!

@mbatha,

Could you provide more details , what secnario you want to achieve that will help to understand your problem and provide sutaiable solution.

I am assuming that

  • Regsiter patient and start visit with one location/department.
  • In Clinical patient queue > Clinical user /Provider will login with same login location then they should see only particuler location/department patients.

Exactly, that is what i meant. I just want to select the location at the time of starting the visit so that i can send the patient to different locations.

Hello @mbatha,

Hoping following configuration will help you with your scenario…!!!

For achieving this scenario you should do the following configuration.

Note : The Location names and Concept location names must be same

  • Ready/Setup your location in openmrs like
    • ANC
    • ART
    • CARDIOLOGY
    • DELIVERY
    • DENTISTRY
  • Setup for Showing the location list on Bahmni EMR Registration 2nd page:
    • Create concept in openmrs:
      • Go to openmrs (login as superman)
      • Create location names concept in openmrs (i.e ANC, ART, CARDIOLOGY )
      • Map these location names concepts to one coded concept (i.e Concept Name “Location” add the answer concepts > “ANC, ART, CARDIOLOGY” ).
    • Add configuration
      • Add following configuration in this file openmrs/apps/registration/extension.json

extension.json

   "Location":{ "id": "bahmni.registration.conceptSetGroup.location",
   "extensionPointId": "org.bahmni.registration.conceptSetGroup.observations",
   "type": "config",
   "extensionParams": {
       "conceptName": "Location",
       "translationKey": "REGISTRATION_LOCATION_REQUIRED_KEY",
       "required":true
   },
   "order": 2,
   "requiredPrivilege": "Edit Visits"

},

  • Update the active patient queue sql:
    • Go to openmrs setting (login as superman)

    • Administration >Maintenance>advanced Settings

    • Search for (emrapi.sqlSearch.activePatients)

    • In sql statement replace with following sql (keep backup of your current sql statement )

      select distinct concat(pn.given_name," ", ifnull(pn.family_name,'')) as name,
            pn.given_name as givenName,
            pn.family_name as familyName,
            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 and v.voided=0
            join patient_identifier pi on v.patient_id = pi.patient_id and pi.voided=0
            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 and p.voided=0
            join encounter en on en.visit_id = v.visit_id and en.voided=0
            join location loc on loc.uuid = ${location_uuid}
            join obs o on o.encounter_id = en.encounter_id and o.voided=0 and o.value_coded=(select concept_id from concept_name where name=loc.name limit 1)
            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")
            where
            v.date_stopped is null
            order by en.encounter_datetime desc;
      

Steps to use:

  • Login to Bahmni EMR and start visit for one patient with location name i.e. Select Location on Registration second page as “ANC” and save.
  • Visit will be started.
  • Provider will login to Bahmni EMR with login location as “ANC”.
  • Navigate to clinical module then he/she will be able to see the patients whom ANC location is selected during start of the visit.
1 Like