The programs app has its own configuration at /var/www/bahmni_config/openmrs/apps/clinical/extension-programs.json . To configure specific search tabs and observation display controls put the related config in extension-programs.json.
Configure Patient Queues (search tabs)
To configure the first tab to search amongst active patients enrolled in programs:
For a patient is enrolled in a program, there can be some additional attribute types that are specific to the patient’s enrollment into the program. These attribute types are called Program Attributes but have various values based on the patient. Examples of Program Attribute types are Program Identifier, Date of Enrollment, Facility of Enrollment, etc.
Bahmni supports the ability to capture values for Program Attribute types. These attributes can be captured or edited during the start or course of the Program and are configurable based on usage needs.
To configure program attributes for the installation,use the SQL query below to add a program attribute. The datatype can be one of the following :
For org.openmrs.customdatatype.datatype.RegexValidatedTextDatatype Attribute Type, datattype_config column should have the valid Regex Pattern.
For org.bahmni.module.bahmnicore.customdatatype.datatype.CodedConceptDatatype Attribute Type, datattype_config column should have Concept Id of the Concept which has the Concept Answers that you want to configure.
Adding program attributes
insert into program_attribute_type(name, description, datatype, min_occurs, creator, date_created, uuid) values('Sample attribute1','This is a test attribute', 'org.openmrs.customdatatype.datatype.FreeTextDatatype', 0, 1, NOW(), UUID());
insert into program_attribute_type(name, description, datatype, datatype_config, min_occurs, creator, date_created, uuid) values('Sample attribute3','This is a NumericRegex attribute', 'org.openmrs.customdatatype.datatype.RegexValidatedTextDatatype', '[0-9]*', 0, 1, NOW(), UUID());
insert into program_attribute_type(name, description, datatype, datatype_config, min_occurs, creator, date_created, uuid) values('Sample attribute2','This is a CodedConcept attribute', 'org.bahmni.module.bahmnicore.customdatatype.datatype.CodedConceptDatatype', 123, 0, 1, NOW(), UUID());
******* 123 is Concept Id
7. Configuring Mandatory Program Attributes
In the app.json of the clinical module, add the following configuration:
If showProgramStateInTimeline is false or not configured, the program states are displayed in tabular format, else it switches to the timeline view.
To configure which program attributes are to be displayed, they have to be added to the list called programAttributes. If the list is empty or the whole key itself is missing, the display control defaults to displaying all program attributes.
If some the attributes are wrongly configured, they will not show up in the UI.
If some attributes don't have any value but are configured, they will show up with just the label and no value.
To hide all the values specify a blank list in the programAttributes.
We can add observations against a program. Whenever you end a program, that program will be listed under past programs. So if you go to patient dashboard through past programs and add some observations, they will be added against that program. In this way you can add observations against past programs.