사용자 정의 인쇄 구성
목적과 이점
Bahmni에서는 구현자가 사용자 정의 표시 제어를 설계할 수 있습니다. 이 제어의 스타일을 조정하여 필요한 사용자 정의 인쇄물을 만들 수 있습니다. 다른 구현별 표시 제어와 달리 여러 종류의 스타일을 따로 관리하는 번거로움을 피하고, 사용자 정의 인쇄물을 보여 줄 표시 제어를 더 쉽게 설계하도록 제공하는 기능입니다. 따라서 사용자 정의 표시 제어와 사용자 정의 인쇄라는 용어를 서로 바꾸어 사용합니다.
절차
Visit 탭에 표시하고 사용자 정의 인쇄물로 출력할 Birth Certificate를 구성한다고 가정합니다. 다른 사용자 정의 인쇄도 비슷한 단계로 구성할 수 있습니다.
1) 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>"
}
}
}
}여러 Visit 탭에 사용자 정의 표시 제어를 나타내려면 visit.json에 다음 구성을 추가해야 합니다. 자세한 내용: https://github.com/Bhamni/default-config/blob/master/openmrs/apps/clinical/visit.json
2) Bahmni의 customDisplayControl 모듈은 애플리케이션과 구성 사이의 기본 연결을 제공합니다.
3) 요구사항에 따라 openmrs/apps/customDisplayControl/js/customControl.js 파일에 새 directive를 추가할 수 있습니다. 새 사용자 정의 directive는 반드시 기존 파일 안에 만드십시오. 자세한 내용: https://github.com/Bhamni/default- config/tree/master/openmrs/apps/customDisplayControl/js
4) 새 directive는 같은 bahmni.common.displaycontrol.custom 모듈 아래에 있어야 하며 scope에는 patient, visitUuid, config가 있어야 합니다.
5) 다음 예시에서는 birthCertificate를 새 directive로 추가합니다.
'use strict';
angular.module('bahmni.common.displaycontrol.custom')
.directive('birthCertificate', ['observationsService', 'appService', 'spinner', function (observationsService, appService, spinner) {
var link = function ($scope) {
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;
}));
};
return {
restrict: 'E',
template: '<ng-include src="contentUrl"/>',
link: link
}
}])위 예시에서는 conceptNames 변수에 새 개념 이름을 구성합니다.
6) openmrs/apps/customDisplayControl/views/ directive 경로에 새 템플릿을 만들 수 있습니다. 자세한 내용: https://github.com/Bhamni/default-config/tree/master/openmrs/apps/customDisplayControl/views
다음 예시에서는 birthCertificate.html 템플릿을 만듭니다.
<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>
주요 필드
| Key Field | Use |
|---|---|
| title | Title of the visit tab. |
| printing | Add printing section to enable the print button on visit page. |
| title | Title in print out. |
| header | header - Header in print out. |
| logo | logo to display in print out. |
| type | "custom" (Required and should always be custom) |
| config | configuration for the custom display control. |
| title | title - title of the custom directive |
| template | the directive which is to be shown |
Bahmni Wiki · CC BY-SA 4.0