Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
titleconfig/openmrs/apps/clinical/extension.json
linenumberstrue
"bahmniCLinicalPatientsSearchActicePatientsForPrograms" : {
  "id": "bahmni.clinical.patients.search.allPatients",
  "extensionPointId": "org.bahmni.patient.search",
  "type": "config",
  "extensionParams": {
    "searchHandler": "emrapi.sqlSearch.activePatientsByProvider",
    "display":"Programs",
    "forwardUrl" : "#/programs/patient/PROGRAMS/{{patientUuid}}/consultationContext"
 },
  "label": "Programs",
  "order": 1,
  "requiredPrivilege": "app:clinical"
}

A new tab "Programs" will be shown in the clinical patient search page

 

...

Configuring Programs app in dashboard

 

Implementer can configure a separate app for 'programs' on the application dashboard. The program app would be the same as the clinical app with separate configuration for patient queues.

 

The name of the extension config will be picked up from app's url. The convention to introduce is that the first param after # in the app's url would be the name of the extension config that needs to be picked up.

Info

As an example, The app's url should look like https://172.18.2.10/bahmni/clinical/#/{{extension_name}}/patient/search

Code Block
languagejs
titlehome/extension.json
linenumberstrue
"programs": {
  "id": "bahmni.programs",
  "extensionPointId": "org.bahmni.home.dashboard",
  "type": "link",
  "label": "Programs",
  "url": "../clinical/#/programs/patient/search",
  "icon": "fa-tasks",
  "order": 2,
  "requiredPrivilege": "app:clinical"
}


And the programs can have its own configuration

Code Block
languagejs
titleclinical/extension-PROGRAMS.json
linenumberstrue
{
  "bahmniClinicalPatientsSearchActivePatientsForPrograms": {
    "id": "bahmni.clinical.patients.search.activePatients",
    "extensionPointId": "org.bahmni.patient.search",
    "type": "config",
    "extensionParams": {
      "searchHandler": "emrapi.sqlSearch.activePatients",
      "display": "Programs",
      "forwardUrl": "#/programs/patient/{{patientUuid}}/consultationContext"
    },
    "label": "Active",
    "order": 1,
    "requiredPrivilege": "app:clinical"
  },
  "bahmniClinicalPatientsSearchAllPatients": {
    "id": "bahmni.clinical.patients.search.allPatients",
    "extensionPointId": "org.bahmni.patient.search",
    "type": "config",
    "extensionParams": {
      "display": "All",
      "forwardUrl": "#/programs/patient/{{patientUuid}}/dashboard"
    },
    "label": "All",
    "order": 2,
    "requiredPrivilege": "app:clinical"
  }
}

 

...

Creating new Programs in OpenMRS

Programs creation is done in OpenMRS app as shown in the gif below. 

Warning

Having more than one workflow for a program is not supported

Warning

Initial & terminal states flags should not be used as they are not supported by Bahmni

...

Associating program to encounter type

To associate program to encounter type, Bahmni uses the generic entity mapping concept which can be configured as explained below

  1. In the entity_mapping_type table, add a record to define the mapping between program and encounter type

    Code Block
    languagesql
    titleentity_mapping_type entry
    insert into entity_mapping_type(name, uuid, entity1_type, entity2_type, date_created) 
    values ('program_encountertype', uuid(), 'org.openmrs.Program', 'org.openmrs.EncounterType', now())
  2. In the entity_mapping table, insert a record to create the mapping between a specific program and the specific encounter type

    Code Block
    languagesql
    titleentity_mapping entry
    insert into entity_mapping(uuid, entity_mapping_type_id, entity1_uuid, entity2_uuid, date_created) 
    values (uuid(), <id_of_the_record_created_in_step_1>, <uuid_of_program>, <uuid_of_encounter_type>, now()) 

 

...

Associating program to observation template

To associate program to observation template (concept), Bahmni uses the same generic entity mapping as above

  1. In the entity_mapping_type table, add a record to define the mapping between program and concept

    Code Block
    languagesql
    titleentity_mapping_type entry
    insert into entity_mapping_type(name, uuid, entity1_type, entity2_type, date_created) 
    values ('program_obstemplate', uuid(), 'org.openmrs.Program', 'org.openmrs.Concept', now())
  2. In the entity_mapping table, insert a record to create the mapping between a specific program and the specific concept

    Code Block
    languagesql
    titleentity_mapping entry
    insert into entity_mapping(uuid, entity_mapping_type_id, entity1_uuid, entity2_uuid, date_created) 
    values (uuid(), <id_of_the_record_created_in_step_1>, <uuid_of_program>, <uuid_of_concept>, now()) 

...

Configuring the dashboard and Medication tab to show data within program enrollment date range

 To view all the data in dashboard and medication tab  within the program enrollment date range add this config to clinical/app.json.

Code Block
languagesql
titleentity_mapping entry
"config" : {
	"program": {
		"showDetailsWithinDateRange" : true,
	}
}

 

...

 

Info

To associate programs to patients, please see this user guide