generated from openmrs/openmrs-esm-template-app
-
Notifications
You must be signed in to change notification settings - Fork 27
/
config-schema.ts
179 lines (177 loc) · 5.88 KB
/
config-schema.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
import { Type } from '@openmrs/esm-framework';
/**
* This is the config schema. It expects a configuration object which
* looks like this:
*
* ```json
* { "casualGreeting": true, "whoToGreet": ["Mom"] }
* ```
*
* In OpenMRS Microfrontends, all config parameters are optional. Thus,
* all elements must have a reasonable default. A good default is one
* that works well with the reference application.
*
* To understand the schema below, please read the configuration system
* documentation:
* https://openmrs.github.io/openmrs-esm-core/#/main/config
* Note especially the section "How do I make my module configurable?"
* https://openmrs.github.io/openmrs-esm-core/#/main/config?id=im-developing-an-esm-module-how-do-i-make-it-configurable
* and the Schema Reference
* https://openmrs.github.io/openmrs-esm-core/#/main/config?id=schema-reference
*/
export const configSchema = {
appName: {
_type: Type.String,
_default: 'Pharmacy',
},
actionButtons: {
pauseButton: {
enabled: {
_type: Type.Boolean,
_description: 'Enabled/Disable including a Pause button in the button action bar',
_default: true,
},
},
closeButton: {
enabled: {
_type: Type.Boolean,
_description: 'Enabled/Disable including a Close button in the button action bar',
_default: true,
},
},
},
dispenseBehavior: {
allowModifyingPrescription: {
_type: Type.Boolean,
_description:
'Enable/Disable editing the prescription. If Disabled, Quantity will be he only editable field on prescription form. Note that thins means that quantity units will need to be mandatory and set correctly on the prescription.',
_default: true,
},
restrictTotalQuantityDispensed: {
_type: Type.Boolean,
_description:
'Enable/Disable restricting dispensing quantity greater than total quantity ordered. Marks prescription as complete when total quantity dispensed. If true, allowModifyingPrescription *must* be false, as this functionality relies solely on numeric quantity and assumes no change in formulation, dosage, unit, etc',
_default: false,
},
},
dispenserProviderRoles: {
_type: Type.Array,
_description:
'Array of provider roles uuids. If specified, only providers with these roles will be listed in the "Dispensed By" dropdown. Note that this simply restricts the providers that can be recorded as Dispensers, it does not limit who can create dispense events.',
_default: [],
},
medicationRequestExpirationPeriodInDays: {
_type: Type.Number,
_description: 'Medication Requests older that this will be considered expired',
_default: 90,
},
locationBehavior: {
locationColumn: {
enabled: {
_type: Type.Boolean,
_description:
'Enabled/Disable including a Location column in the main prescriptions table showing ordering location',
_default: false,
},
},
locationFilter: {
enabled: {
_type: Type.Boolean,
_description: 'Enable/Disable Location filter on main prescriptions page',
_default: false,
},
tag: {
_type: Type.String,
_description: 'Name of the location tag to use when fetching locations to populate filter',
_default: 'Login Location',
},
},
},
refreshInterval: {
_type: Type.Number,
_description: 'The interval, in milliseconds, to query the backend for new/changed data',
_default: 60000,
},
valueSets: {
reasonForPause: {
uuid: {
_type: Type.UUID,
_description:
"UUID for the Value Set of valid answers to the 'Reason for Pause' question. Defaults to CIEL value set: https://app.openconceptlab.org/#/orgs/CIEL/sources/CIEL/concepts/168099/",
_default: '2dd3e5c0-3d3f-4f3d-9860-19b3f9ab26ff',
},
},
reasonForClose: {
uuid: {
_type: Type.UUID,
_description:
"UUID for the Value Set of valid answers to the 'Reason for Close' question. Defaults to CIEL value set: https://app.openconceptlab.org/#/orgs/CIEL/sources/CIEL/concepts/168099/",
_default: 'bd6c1fc2-7cfc-4562-94a0-e4765e5e977e',
},
},
substitutionReason: {
uuid: {
_type: Type.UUID,
_description:
"UUID for the Value Set of valid answers to the 'Reason for Substitution' question. Defaults to CIEL value set: https://app.openconceptlab.org/#/orgs/CIEL/sources/CIEL/concepts/167862/",
_default: 'de8671b8-ed2e-4f7e-a9f8-dcd00878f2eb',
},
},
substitutionType: {
uuid: {
_type: Type.UUID,
_description:
"UUID for the Value Set of valid answers to the 'Type of Substitution' question. Defaults to CIEL value set: https://app.openconceptlab.org/#/orgs/CIEL/sources/CIEL/concepts/167859/",
_default: 'b9c5bca0-d026-4245-a4d2-e4c0a8999082',
},
},
},
enableStockDispense: {
_type: Type.Boolean,
_description:
'Enable or disable stock deduction during the dispensing process. Requires the stock management module to be installed and configured.',
_default: false,
},
};
export interface PharmacyConfig {
appName: string;
actionButtons: {
pauseButton: {
enabled: boolean;
};
closeButton: {
enabled: boolean;
};
};
refreshInterval: number;
dispenseBehavior: {
allowModifyingPrescription: boolean;
restrictTotalQuantityDispensed: boolean;
};
dispenserProviderRoles: [];
medicationRequestExpirationPeriodInDays: number;
locationBehavior: {
locationColumn: {
enabled: boolean;
};
locationFilter: {
enabled: boolean;
tag: string;
};
};
valueSets: {
reasonForPause: {
uuid: string;
};
reasonForClose: {
uuid: string;
};
substitutionReason: {
uuid: string;
};
substitutionType: {
uuid: string;
};
};
enableStockDispense: boolean;
}