Print Forms
Purpose and Benefits
The “Print Forms” feature provides doctors the ability to print out forms in the system so that they can hand over the form to the IPD department. For example, we have an admission order form, which the doctor fills out . Since there is no alerting mechanism , until the IPD ward nurse receives the form, they have to rely on the printing of the admission order form which is sent to the IPD ward.
The print button would appear as shown in the screenshot below:
Sample PDF file generated on clicking print button for History and Examination form is added as an example:
Configure Print Forms Feature:
Below configuration required to be added to the forms display control configurations in clinical/dashboard.json
to enable print medication functionality.
"forms-v2-react": {
"type": "formsV2React",
.....
"dashboardConfig": {
.....
"printing": {
"printDiagnosis":{
"order": "PRIMARY",
"certainity": "CONFIRMED"
},
"observationsConcepts": ["WEIGHT"],
"templateUrl": "/bahmni_config/openmrs/apps/clinical/clinicalPrints/formPrint.html",
"title": "Bahmni Hospital",
"logo": "logo.png"
}
},
}
Config Descriptions:
Field Name | Description | Mandatory |
---|---|---|
printing | Config to enable the print functionality. This configuration is required for the print button to be shown in the forms view page. | Yes |
printDiagnosis | This is type of diagnosis we want to print in the form print. For eg: if we want to show the diagnosis which are primary and confirmed, we need to give the | No |
observationsConcepts | This is a list of concepts. This is to fetch the latest observation captured for the patients for the given concepts which can then be consumed in the custom template to show values like patient's height, weight, etc. | No |
templateUrl | This field is required for the custom template to be used for printing the forms. If we want a default Bahmni's template and not the custom one, we need to remove this config | No |
Note: If we want to show these custom options like diagnosis, observations, etc. in the pdf, then we need to give a custom template that’ll include html elements with appropriate css to show these data. One can refer this sample html (formPrint.html) below
Sample formPrint.html :
<link rel="stylesheet" href="/bahmni_config/openmrs/apps/clinical/clinicalPrints/css/print.css"/>
<style>
@media print {
/* Hide the header */
@page { margin-top: 20px; }
header, .header {
display: none !important;
}
/* Hide the footer */
@page { margin-bottom: 20px; }
footer, .footer {
display: none !important;
}
}
</style>
<div class="print-wrapper custom-print-style">
<div class="print-header" ng-if="printConfig">
<div class="print-logo-plus-text">
<img class="print-logo" width="125px" ng-if="printConfig.logo" ng-src="{{printConfig.logo}}" alt="logo"/>
<h1 class="print-logo-text">{{printConfig.title}}</h1>
<div class="print-right"></div>
</div>
<div class="clinic-info">
<span> {{printConfig.header}}</span>
</div>
<div style="float: left;text-align: left;font-size: 10pt;font-weight: bold;margin-bottom: 10px;margin-top: 10px;"
ng-bind-html="additionalInfo.facilityLocation.address5"></div>
</div>
<!-- Patient Info -->
<div class="patient-info">
<table>
<tr>
<td colspan="2" style="font-size: 12pt;">Name of the Patient: <span class="value">{{patient.name}} ({{patient.identifier}})</span></td>
<td>Date : <span class="value">{{additionalInfo.currentDate | bahmniDate}}</span></td>
</tr>
<tr>
<td>Age: <span class="value">
{{patient.birthdate | dateToAge:visit.dateStarted}}
</span></td>
<td>Sex: <span class="value">{{patient.genderText.substring(6, patient.genderText.length - 7)}}</span></td>
<td>Weight: <span class="value">{{observationsEntries[0].value}} {{observationsEntries[0].concept.units}}</span></td>
</tr>
<tr>
<td>Address: <span class="value">{{patient.address.address5}}</span></td>
<td>Kebele: <span class="value">{{patient.address.address4}}</span></td>
<td>Woreda: <span class="value">{{patient.address.address3}}</span></td>
</tr>
<tr>
<td>Zone: <span class="value">{{patient.address.address2}}</span></td>
<td>Region: <span class="value">{{patient.address.address1}}</span></td>
<td>Country: <span class="value">{{patient.address.country}}</span></td>
</tr>
<tr>
<td>Tel no: <span class="value">{{patient.mobilePhone.value}}</span></td>
<td colspan="2">Visit Type: <span class="value"> {{additionalInfo.visitType}} </span></td>
</tr>
<tr>
<td>Diagnosis (ICD-10 code): <span class="value">{{ diagnosesWithCodes }}</span></td>
<td colspan="2">Allergies: <span class="value"> {{ allergies.length > 0 ? allergies : "No allergies recorded for this patient"}} </span></td>
</tr>
<tr>
</tr>
</table>
</div>
<!-- Form Info -->
<div class="sections-group">
<div class="section">
<section class="block observation dashboard-section" id="observationSection">
<ul bm-gallery access-impression="true">
<section class="block " ng-class="::{'hidden-print': noObsMessage}">
<h2 class="tableMargin"
ng-class="::{'section-title': !isFulfilmentDisplayControl, 'form-field': isFulfilmentDisplayControl}">{{::title |
translate}}</h2>
<div class="concept-set-container-view">
<section class="block hierarchy">
<ul class="form-field" ng-if="bahmniObservations.length > 0">
<li class="tableMargin" ng-repeat="obsGroup in ::bahmniObservations">
<span class="tree-list-item row-click toggle-container" toggle="obsGroup.isOpen">
<span class="obs-date" ng-if="obsGroup.value.length > 0">
{{::obsGroup.date | bahmniDateTime}}
</span>
</span>
<ul class="print-observations visible-print">
<li class="tableBorder" ng-repeat="observation in ::obsGroup.value track by $index">
<ul>
<show-observation show-details-button="::config.showDetailsButton" patient="::patient"
observation="::observation"
level="2"
template-url="/bahmni_config/openmrs/apps/clinical/clinicalPrints/showObservations.html">
</show-observation>
</ul>
</li>
</ul>
</li>
</ul>
<div ng-if="::noObsMessage">
<div class="placeholder-text" ng-if="::!message"><p translate="DISPLAY_CONTROL_ERROR_MESSAGE_KEY"
translate-values="::{displayControl : '{{title | translate}}'}"></p>
</div>
<div class="placeholder-text" ng-if="::message">{{::message|translate}}</div>
</div>
</section>
</div>
</section>
</ul>
</section>
</div>
</div>
<!-- Footer -->
<div class="print-form-footer">
<label for="other-notes">Other Notes :</label>
<input type="text" id="other-notes" class="other-notes" />
<span class="footer-table-left">
<table>
<tr>
<td>Signature: </td>
</tr>
</table>
</span>
<span class="footer-table-right">
<table>
<tr>
<td>Date: </td>
</tr>
</table>
</span>
</div>
</div>
The Bahmni documentation is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)