Custom Controls
Purpose
Configuration
Sample Configuration
"customControl": {
"type": "custom",
"config": {
"title": "Title of the Control",
"template": "<directive-name></directive-name>"
}
}Key Field Table
| Key | Information | Mandatory | |
|---|---|---|---|
| type | type of the section or control.type should be "custom" | Yes | |
| config | key | Information | Mandatory |
| title | title to be displayed | Yes | |
| template | the directive to be used to show the control | Yes |
Bahmni allows implementers to create their own custom display control.
Custom Control on Visit Dashboard
The following configuration needs to be added in visit.json (openmrs/apps/clinical/visit.json) to display the custom display control in different visit tabs.
Consider the following example to configure the birth certificate:
"birthCertificate": {
"title": "Birth Certificate",
"printing": {
"title": "Bahmni",
"header": "Certificate",
"logo": "../images/bahmniLogo.png"
},
"sections": {
"Birth Certificate": {
"type": "custom",
"config": {
"title": "Birth Certificate",
"template": "<birth-certificate></birth-certificate>"
}
}
}
}| Key | Information | |
|---|---|---|
| title | Title of the visit tab. | Y |
| printing | Add printing section to enable the print button on visit page. | Y |
| title - Title in print out. | ||
| header - Header in print out. | ||
| logo - Logo to display in print out. | ||
| type | "custom" (Required and should always be custom) | Y |
| config | configuration for the custom display control. | |
| title - title of the custom directive | Y | |
| template - the directive which you want to show. | Y |
Custom control on Patient Dashboard
The following configuration needs to be added under sections in dashboard.json (openmrs/apps/clinical/dashboard.json) to display the custom display control in different dashboard tabs.
Consider the following example to configure the birth certificate:
"General": {
"translationKey": "DASHBOARD_TAB_GENERAL_KEY",
"sections": {
"Birth Certificate": {
"type": "custom",
"config": {
"title": "Birth Certificate",
"template": "<birth-certificate></birth-certificate>"
}
}
}
}| Key | Information | Mandatory | |
|---|---|---|---|
| type* | "custom" (Required and should always be custom) | Y | |
| config | key | Information | |
| title | title of the custom directive | Y | |
| template | the directive which you want to show | Y |
Bahmni provides customDisplayControl module which provides basic connection between the application and configuration.
You can add new directives as per your requirement in the "openmrs/apps/customDisplayControl/js/customControl.js" file. (Make sure you can create new custom directives only in the existing file)
New directives should be under the same module. ("bahmni.common.displaycontrol.custom"). The scope of the new directive will have patient, visitUuid and config.
Table of Contents
Table of Contents
하위 문서
Bahmni Wiki · CC BY-SA 4.0