Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Purpose
Excerpt |
---|
It can be used to create a control to add a Birth Certificate |
Configuration
Add a birthCertificate directive
Consider the following example to add a birthCertificate as a new directive:
Code Block | ||||
---|---|---|---|---|
| ||||
'use strict';
angular.module('bahmni.common.displaycontrol.custom')
.directive('birthCertificate', ['observationsService', 'appService', 'spinner', function (observationsService, appService, spinner) {
var link = function ($scope,element) {
var conceptNames = ["HEIGHT"];
$scope.contentUrl = appService.configBaseUrl() + "/customDisplayControl/views/birthCertificate.html";
spinner.forPromise(observationsService.fetch($scope.patient.uuid, conceptNames, "latest", undefined, $scope.visitUuid, undefined).then(function (response) {
$scope.observations = response.data;
}), element);
};
return {
restrict: 'E',
template: '<ng-include src="contentUrl"/>',
link: link
}
}]) |
Note |
---|
|
Create a birthCertificate Display page
Consider the following example to create a birthCertificate.html:
Code Block | ||||
---|---|---|---|---|
| ||||
<div>
{{config.title}}
<section class="dashboard-section">
<ul class="form-field">
<li ng-repeat="obsGroup in observations">
<span class="obs-date"> {{obsGroup.conceptNameToDisplay }} </span>
<span class="obs-date"> {{obsGroup.value}} </span>
</li>
</ul>
</section>
</div> |
Tip | ||
---|---|---|
| ||
|
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
|