To associate a program to an encounter type, Bahmni uses the generic entity mapping concept which can be configured as explained below.
a) In the entity_mapping_type table, add a record to define the mapping between program and encounter type:
Code Block |
---|
language | sql |
---|
linenumbers | true |
---|
|
insert into entity_mapping_type(name, uuid, entity1_type, entity2_type, date_created) values ('program_encountertype', uuid(), 'org.openmrs.Program', 'org.openmrs.EncounterType', now()); |
b) In the entity_mapping table, insert a record to create the mapping between a specific program and the specific encounter type
Code Block |
---|
language | sql |
---|
linenumbers | true |
---|
|
insert into entity_mapping(uuid, entity_mapping_type_id, entity1_uuid, entity2_uuid, date_created) values (uuid(), <id_of_the_record_created_in_step_4a>, <uuid_of_program>, <uuid_of_encounter_type>, now()); |
5. Associate an Observation template to a Program
To associate an observation template (as a concept) to a program, Bahmni uses the same generic entity mapping as above. To do this, follow the below steps
a) In the entity_mapping_type table, add a record to define the mapping between program and concept
Code Block |
---|
language | sql |
---|
linenumbers | true |
---|
|
insert into entity_mapping_type(name, uuid, entity1_type, entity2_type, date_created) values ('program_obstemplate', uuid(), 'org.openmrs.Program', 'org.openmrs.Concept', now()); |
b) In the entity_mapping table, insert a record to create the mapping between a specific program and the specific concept
Code Block |
---|
language | sql |
---|
linenumbers | true |
---|
|
insert into entity_mapping(uuid, entity_mapping_type_id, entity1_uuid, entity2_uuid, date_created) values (uuid(), <id_of_the_record_created_in_step_5a>, <uuid_of_program>, <uuid_of_concept>, now()); |
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 :
Code Block |
---|
language | sql |
---|
linenumbers | true |
---|
|
org.openmrs.customdatatype.datatype.FreeTextDatatype
org.openmrs.customdatatype.datatype.BooleanDatatype
org.openmrs.customdatatype.datatype.DateDatatype
org.openmrs.customdatatype.datatype.RegexValidatedTextDatatype
org.bahmni.module.bahmnicore.customdatatype.datatype.CodedConceptDatatype |
Info |
---|
|
- 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.
|
Code Block |
---|
language | sql |
---|
title | Adding program attributes |
---|
linenumbers | true |
---|
|
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:
Code Block |
---|
language | js |
---|
title | Configuring mandatory program attributes |
---|
linenumbers | true |
---|
|
"config" : {
"program": {
"programAttributeName" : {
"required" : true
}
}
} |
(Feature available from 0.90 release)
8. Hiding specific Program Attributes For Program
In the app.json of the clinical module, add the following configuration to hide specific Program Attributes based on Program selected.
Code Block |
---|
language | js |
---|
title | Hiding specific Program Attributes |
---|
linenumbers | true |
---|
|
"config" : {
"program": {
"programAttributeName" : {
"excludeFrom" : ["ProgramName"]
}
}
} |
In the app.json of the clincal module, add the following configuration. This shows the patient age only in years on program management page.
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
"config" : {
"program": {
"patientInformation": {
"ageLimit":100
}
}
} |
10. Configuring display control for Program Attributes
In the app.json of the clinical module, add the following configuration:
Code Block |
---|
language | js |
---|
title | Configuring mandatory program attributes |
---|
linenumbers | true |
---|
|
"config" : {
"programDisplayControl": {
"showProgramStateInTimeline": true,
"programAttributes": [
"Treatment_Date",
"Doctor",
"Id"
]
}
} |
Note |
---|
- 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.
|
11. Retire a Program
Refer Retire Programs
12. Adding observations for Past Programs
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.