등록 앱
설명
등록 앱 구성에는 app.json과 extension.json 파일이 필요합니다.
앱 구성
app.json 구성
다만 config 객체에는 구현별로 조정할 수 있는 여러 구성이 들어갈 수 있습니다. app.json 상수 섹션과 app.json config 객체가 이에 포함됩니다.
app.json 상수 섹션
Code Snippet
{
"id": "bahmni.registration",
"instanceOf":"bahmni.template.registration",
"description": "Bahmni Patient Registration App",
"extensionPoints": [
{
"id": "org.bahmni.registration.patient.search.result.action",
"description": "Bahmni Patient Search Result Action"
},
{
"id": "org.bahmni.registration.patient.next",
"description": "After Bahmni Patient Registration, forward url configuration"
}
],
"contextModel": [
"patientUuid",
"activeVisitUuid"
],
"config" : {}
}app.json 구성
Code Snippet
"config" : {
"patientInformation": { // Configuration for the Patient Information and Additional Patient Information on the Patient Information page (New Patient registration or edit pages)
"additionalPatientInformation": { // Optional. Configuration for the Additional Patient Information section
"title": "Additional Patient Information", //Title of Additional Patient Information section
"attributes": [] // Array of person attribute names to be shown under the Additional Patient Information Section
},
"defaults": { //Default value for person attributes
"attributeName": "Attribute Value",
}
},
"addressHierarchy": { // Optional. Configurations possible for address hierarchy
"showAddressFieldsTopDown": false, // Optional. Determines order of address fields
"freeTextAddressFields": ["address2", "address1"]
},
"relationshipTypeMap": { //Map of relationship type name to the relationship type. Relationship Name should be a valid Relationship in OpenMRS. Relationship type can be either "provider" or "patient"
"relationshipName":"provider | patient"
},
"autoCompleteFields":["givenName | familyName | personAttribute Type name"], // Array of fields that can be autocompleted. Autocompletion is based on values already available in the OpenMRS database for that field. Note that address fields cannot be set to autocomplete here. Use the address hierarchy instead
"defaultIdentifierPrefix": "GAN", // Default identifier prefix
"defaultVisitType": "OPD", // Default Visit Type on the visit types dropdown
"searchByIdForwardUrl": "/patient/{{patientUuid}}", //Url to go to when a patient is selected on the search page
"showMiddleName": true, // Show/hide middle name
"showLastName": true, // Show/hide last name
"isLastNameMandatory": true, // Make last name as mandatory/non-mandatory field. If we make showLastName as false, then this config is not require
"printOptions": [
{
"label": "Title" // Title of print
"translationKey": "REGISTRATION_PRINT_REG_CARD_LOCAL_KEY", //Optional key for internationalization
"templateUrl": "/url/of/custom/print/html/file", // Url to look for custom print html file
"shortcutKey": "l" // Shortcut key to print
}
],
"conceptSetUI": { // Configuration for concepts on the concept set UI page. See conceptSetUI configuration on clinical app.json for more information
},
"fieldValidation" : { // Regex pattern based validation for fields on Patient Registration screen
"givenName | middleName | familyName | addressFieldNames | personAttributeName | " : {"pattern" : "some nice regex", "errorMessage" : "When pattern not matched"},
}
}등록 화면 섹션 표시/숨기기
이 구성은 조건에 따라 새 환자 등록 페이지의 섹션을 표시하거나 숨깁니다. bahmni_config/openmrs/apps/registration에 있는 attributesConditions.js를 구성해야 합니다.
예: 나이가 18세 미만일 때만 Guardian Details 섹션을 표시합니다.
Code Snippet
"patientInformation": {
"patientContact": {
"title": "Patient Contact",
"translationKey": "Patient Contact",
"attributes": [
"phoneNumber1",
"phoneNumber2",
"emailAddress",
]
},
"guardian": {
"title": "Guardian Details",
"translationKey": "Guardian Details",
"attributes": [
"guardianNameEnglish",
"guardianGender",
"guardianDob",
"guardianAge",
"guardianNationality"
]
},
}여기서 patientContact와 guardian은 섹션입니다. 아래 JavaScript는 나이가 18세보다 많을 때 guardian 섹션을 표시하는 데 필요합니다.
참고:
- age는 조건을 작성할 필드입니다.
- patient를 매개변수로 받는 함수를 작성해야 합니다. patient 객체에는 양식에 입력된 모든 값이 들어 있습니다. 값은 patient["<attribute name>"] 형태로 접근합니다.
- 해당 환자 속성 값, 이 예에서는 age가 변경될 때마다 함수가 호출됩니다.
- 함수는 show와 hide 변수가 있는 객체를 반환해야 합니다. 두 변수는 표시하거나 숨길 섹션 이름의 배열입니다.
- age, gender, birthdate, birthtime, birthdateEstimated 및 기타 환자 속성에 따라 조건을 작성할 수 있습니다. 예를 들어 세 번째 함수의 isGuardianRequired는 환자 속성입니다. 선택하면 Guardian Details 섹션을 표시하고 아니면 숨깁니다. returnValues.show.push("guardian")의 guardian은 위 첫 번째 코드 블록에 있는 섹션 키입니다.
Code Snippet
var showOrHideGuardianSection = function (patient) {
var returnValues = {
show: [],
hide: []
};
if (patient["age"].years < 18) {
returnValues.show.push("guardian")
} else {
returnValues.hide.push("guardian")
}
return returnValues
};
Bahmni.Registration.AttributesConditions.rules = {
'age': function (patient) {
return showOrHideGuardianSection(patient);
},
'birthdate': function (patient) {
return showOrHideGuardianSection(patient);
},
'isGuardianRequired': function(patient) {
var returnValues = {
show: [],
hide: []
};
if (patient["isGuardianRequired"]) {
returnValues.show.push("guardian");
} else {
returnValues.hide.push("guardian");
}
return returnValues;
}
};환자 등록 화면을 떠날 때 확인 메시지 표시
임상 모듈이 저장하지 않은 데이터를 저장하라고 알리는 것처럼 등록 모듈도 현재 환자 등록 첫 페이지를 벗어나지 못하도록 확인 메시지를 표시합니다. 임상 모듈과 달리 현재 등록 모듈의 메시지에서는 양식을 저장할 수 없습니다. 이 기능은 구성할 수 있으며 등록 모듈 app.json의 config 섹션에 설정을 추가합니다. true 또는 false를 전달할 수 있고 기본값은 false입니다.
Sample Config
“config” : {
.....
“showSaveConfirmDialog” : true
}목차
하위 문서
원문 정보
원문 보기 ↗Bahmni Wiki · CC BY-SA 4.0