• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openmrs / openmrs-core / 23193642646

17 Mar 2026 12:13PM UTC coverage: 63.1% (-0.3%) from 63.429%
23193642646

push

github

rkorytkowski
Fixing: Fix an issue with the ModuleResourceServlet

0 of 2 new or added lines in 1 file covered. (0.0%)

925 existing lines in 17 files now uncovered.

23137 of 36667 relevant lines covered (63.1%)

0.63 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

17.0
/api/src/main/java/org/openmrs/util/OpenmrsConstants.java
1
/**
2
 * This Source Code Form is subject to the terms of the Mozilla Public License,
3
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
4
 * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
5
 * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
6
 *
7
 * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
8
 * graphic logo is a trademark of OpenMRS Inc.
9
 */
10
package org.openmrs.util;
11

12
import static java.util.Arrays.asList;
13

14
import java.io.IOException;
15
import java.io.InputStream;
16
import java.util.ArrayList;
17
import java.util.Collection;
18
import java.util.Collections;
19
import java.util.LinkedHashMap;
20
import java.util.List;
21
import java.util.Locale;
22
import java.util.Map;
23
import java.util.Properties;
24

25
import liquibase.GlobalConfiguration;
26
import org.apache.commons.io.IOUtils;
27
import org.openmrs.GlobalProperty;
28
import org.openmrs.api.handler.ExistingVisitAssignmentHandler;
29
import org.openmrs.customdatatype.datatype.BooleanDatatype;
30
import org.openmrs.customdatatype.datatype.FreeTextDatatype;
31
import org.openmrs.hl7.HL7Constants;
32
import org.openmrs.module.ModuleConstants;
33
import org.openmrs.module.ModuleFactory;
34
import org.openmrs.patient.impl.LuhnIdentifierValidator;
35
import org.slf4j.Logger;
36
import org.slf4j.LoggerFactory;
37

38
/**
39
 * Constants used in OpenMRS. Contents built from build properties (version, version_short, and
40
 * expected_database). Some are set at runtime (database, database version). This file should
41
 * contain all privilege names and global property names. Those strings added to the static CORE_*
42
 * methods will be written to the database at startup if they don't exist yet.
43
 */
44
public final class OpenmrsConstants {
45
        
46
        private static final Logger log = LoggerFactory.getLogger(OpenmrsConstants.class);
1✔
47
        
48
        public static String KEY_OPENMRS_APPLICATION_DATA_DIRECTORY = "OPENMRS_APPLICATION_DATA_DIRECTORY";
1✔
49
        
50
        /**
51
         * This is the hard coded primary key of the concept class for DRUG. This has to be done because
52
         * some logic in the API acts on this concept class
53
         */
54
        public static final int CONCEPT_CLASS_DRUG = 3;
55
        
56
        /**
57
         * hack alert: During an ant build, the openmrs api jar manifest file is loaded with these
58
         * values. When constructing the OpenmrsConstants class file, the api jar is read and the values
59
         * are copied in as constants
60
         */
61
        private static final Package THIS_PACKAGE = OpenmrsConstants.class.getPackage();
1✔
62
        
63
        /**
64
         * This holds the current openmrs code version. This version is a string containing spaces and
65
         * words.<br>
66
         * The format is:<br>
67
         * <i>major</i>.<i>minor</i>.<i>maintenance</i> <i>suffix</i> Build <i>buildNumber</i>
68
         */
69
        public static final String OPENMRS_VERSION = THIS_PACKAGE.getSpecificationVendor() != null ? THIS_PACKAGE
1✔
70
                .getSpecificationVendor() : (getBuildVersion() != null ? getBuildVersion() : getVersion());
1✔
71
        
72
        /**
73
         * This holds the current openmrs code version in a short space-less string.<br>
74
         * The format is:<br>
75
         * <i>major</i>.<i>minor</i>.<i>maintenance</i>.<i>revision</i>-<i>suffix</i>
76
         */
77
        public static final String OPENMRS_VERSION_SHORT = THIS_PACKAGE.getSpecificationVersion() != null ? THIS_PACKAGE
1✔
78
                .getSpecificationVersion() : (getBuildVersionShort() != null ? getBuildVersionShort() : getVersion());
1✔
79
        
80
        /**
81
         * @return build version with alpha characters (eg:1.10.0 SNAPSHOT Build 24858)
82
         * defined in MANIFEST.MF(specification-Vendor)
83
         *
84
         * @see #OPENMRS_VERSION_SHORT
85
         * @see #OPENMRS_VERSION
86
         */
87
        private static String getBuildVersion() {
88
                return getOpenmrsProperty("openmrs.version.long");
1✔
89
        }
90
        
91
        /**
92
         * @return build version without alpha characters (eg: 1.10.0.24858)
93
         * defined in MANIFEST.MF (specification-Version)
94
         *
95
         * @see #OPENMRS_VERSION_SHORT
96
         * @see #OPENMRS_VERSION
97
         */
98
        private static String getBuildVersionShort() {
99
                return getOpenmrsProperty("openmrs.version.short");
1✔
100
        }
101
        
102
        private static String getVersion() {
UNCOV
103
                return getOpenmrsProperty("openmrs.version");
×
104
        }
105
        
106
        public static String getOpenmrsProperty(String property) {
107
                InputStream file = OpenmrsConstants.class.getClassLoader().getResourceAsStream("org/openmrs/api/openmrs.properties");
1✔
108
                if (file == null) {
1✔
UNCOV
109
                        log.error("Unable to find the openmrs.properties file");
×
110
                        return null;
×
111
                }
112
                
113
                try {
114
                        Properties props = new Properties();
1✔
115
                        props.load(file);
1✔
116
                        
117
                        file.close();
1✔
118
                        
119
                        return props.getProperty(property);
1✔
120
                }
UNCOV
121
                catch (IOException e) {
×
122
                        log.error("Unable to parse the openmrs.properties file", e);
×
123
                }
124
                finally {
125
                        IOUtils.closeQuietly(file);
1✔
126
                }
127
                
UNCOV
128
                return null;
×
129
        }
130
        
131
        public static String DATABASE_NAME = "openmrs";
1✔
132
        
133
        public static String DATABASE_BUSINESS_NAME = "openmrs";
1✔
134
        
135
        /**
136
         * Set true from runtime configuration to obscure patients for system demonstrations
137
         */
138
        public static boolean OBSCURE_PATIENTS = false;
1✔
139
        
140
        public static String OBSCURE_PATIENTS_GIVEN_NAME = "Demo";
1✔
141
        
142
        public static String OBSCURE_PATIENTS_MIDDLE_NAME = null;
1✔
143
        
144
        public static String OBSCURE_PATIENTS_FAMILY_NAME = "Person";
1✔
145
        
146
        public static final String REGEX_LARGE = "[!\"#\\$%&'\\(\\)\\*,+-\\./:;<=>\\?@\\[\\\\\\\\\\]^_`{\\|}~]";
147
        
148
        public static final String REGEX_SMALL = "[!\"#\\$%&'\\(\\)\\*,\\./:;<=>\\?@\\[\\\\\\\\\\]^_`{\\|}~]";
149
        
150
        public static final Integer CIVIL_STATUS_CONCEPT_ID = 1054;
1✔
151
        
152
        /**
153
         * The directory which OpenMRS should attempt to use as its application data directory
154
         * in case the current users home dir is not writeable (e.g. when using application servers
155
         * like tomcat to deploy OpenMRS).
156
         *
157
         * @see #APPLICATION_DATA_DIRECTORY_RUNTIME_PROPERTY
158
         * @see OpenmrsUtil#getApplicationDataDirectory()
159
         */
160
        public static final String APPLICATION_DATA_DIRECTORY_FALLBACK_UNIX = "/var/lib";
161
        
162
        public static final String APPLICATION_DATA_DIRECTORY_FALLBACK_WIN = System.getenv("appdata");
1✔
163
        
164
        /**
165
         * The name of the runtime property that a user can set that will specify where openmrs's
166
         * application directory is
167
         * 
168
         * @see OpenmrsUtil#getApplicationDataDirectory()
169
         * @see OpenmrsUtil#startup(java.util.Properties)
170
         */
171
        public static final String APPLICATION_DATA_DIRECTORY_RUNTIME_PROPERTY = "application_data_directory";
172
        
173
        /**
174
         * The name of the runtime property that a user can set that will specify whether the database
175
         * is automatically updated on startup
176
         */
177
        public static final String AUTO_UPDATE_DATABASE_RUNTIME_PROPERTY = "auto_update_database";
178
        
179
        /**
180
         * These words are ignored in concept and patient searches
181
         *
182
         * @return Collection&lt;String&gt; of words that are ignored
183
         */
184
        public static final Collection<String> STOP_WORDS() {
UNCOV
185
                List<String> stopWords = new ArrayList<>();
×
186
                stopWords.add("A");
×
187
                stopWords.add("AND");
×
188
                stopWords.add("AT");
×
189
                stopWords.add("BUT");
×
190
                stopWords.add("BY");
×
191
                stopWords.add("FOR");
×
192
                stopWords.add("HAS");
×
193
                stopWords.add("OF");
×
194
                stopWords.add("THE");
×
195
                stopWords.add("TO");
×
196
                
UNCOV
197
                return stopWords;
×
198
        }
199
        
200
        /**
201
         * A gender character to gender name map<br>
202
         * TODO issues with localization. How should this be handled?
203
         * @deprecated As of 2.2, replaced by {@link #GENDERS}
204
         *
205
         * @return Map&lt;String, String&gt; of gender character to gender name
206
         */
207
        @Deprecated
208
        @SuppressWarnings("squid:S00100")
209
        public static final Map<String, String> GENDER() {
UNCOV
210
                Map<String, String> genders = new LinkedHashMap<>();
×
211
                genders.put("M", "Male");
×
212
                genders.put("F", "Female");
×
213
                return genders;
×
214
        }
215
        
216
        /**
217
         * A list of 1-letter strings representing genders
218
         */
219
        public static final List<String> GENDERS = Collections.unmodifiableList(asList("M", "F"));
1✔
220
        
221
        /**
222
         * These roles are given to a user automatically and cannot be assigned
223
         *
224
         * @return <code>Collection&lt;String&gt;</code> of the auto-assigned roles
225
         */
226
        public static final Collection<String> AUTO_ROLES() {
UNCOV
227
                List<String> roles = new ArrayList<>();
×
228
                
UNCOV
229
                roles.add(RoleConstants.ANONYMOUS);
×
230
                roles.add(RoleConstants.AUTHENTICATED);
×
231
                
UNCOV
232
                return roles;
×
233
        }
234
        
235
        public static final String GLOBAL_PROPERTY_DRUG_FREQUENCIES = "dashboard.regimen.displayFrequencies";
236
        
237
        public static final String GLOBAL_PROPERTY_CONCEPTS_LOCKED = "concepts.locked";
238
        
239
        public static final String GLOBAL_PROPERTY_PATIENT_LISTING_ATTRIBUTES = "patient.listingAttributeTypes";
240
        
241
        public static final String GLOBAL_PROPERTY_PATIENT_VIEWING_ATTRIBUTES = "patient.viewingAttributeTypes";
242
        
243
        public static final String GLOBAL_PROPERTY_PATIENT_HEADER_ATTRIBUTES = "patient.headerAttributeTypes";
244
        
245
        public static final String GLOBAL_PROPERTY_USER_LISTING_ATTRIBUTES = "user.listingAttributeTypes";
246
        
247
        public static final String GLOBAL_PROPERTY_USER_VIEWING_ATTRIBUTES = "user.viewingAttributeTypes";
248
        
249
        public static final String GLOBAL_PROPERTY_USER_HEADER_ATTRIBUTES = "user.headerAttributeTypes";
250
        
251
        public static final String GLOBAL_PROPERTY_USER_REQUIRE_EMAIL_AS_USERNAME = "user.requireEmailAsUsername";
252
        
253
        public static final String GLOBAL_PROPERTY_HL7_ARCHIVE_DIRECTORY = "hl7_archive.dir";
254
        
255
        public static final String GLOBAL_PROPERTY_DEFAULT_THEME = "default_theme";
256
        
257
        public static final String GLOBAL_PROPERTY_APPLICATION_NAME = "application.name";
258
        
259
        /**
260
         * Array of all core global property names that represent comma-separated lists of
261
         * PersonAttributeTypes. (If you rename a PersonAttributeType then these global properties are
262
         * potentially modified.)
263
         */
264
        public static final String[] GLOBAL_PROPERTIES_OF_PERSON_ATTRIBUTES = { GLOBAL_PROPERTY_PATIENT_LISTING_ATTRIBUTES,
1✔
265
                GLOBAL_PROPERTY_PATIENT_VIEWING_ATTRIBUTES, GLOBAL_PROPERTY_PATIENT_HEADER_ATTRIBUTES,
266
                GLOBAL_PROPERTY_USER_LISTING_ATTRIBUTES, GLOBAL_PROPERTY_USER_VIEWING_ATTRIBUTES,
267
                GLOBAL_PROPERTY_USER_HEADER_ATTRIBUTES, GLOBAL_PROPERTY_USER_REQUIRE_EMAIL_AS_USERNAME };
268
        
269
        public static final String GLOBAL_PROPERTY_PATIENT_IDENTIFIER_REGEX = "patient.identifierRegex";
270
        
271
        public static final String GLOBAL_PROPERTY_PATIENT_IDENTIFIER_PREFIX = "patient.identifierPrefix";
272
        
273
        public static final String GLOBAL_PROPERTY_PATIENT_IDENTIFIER_SUFFIX = "patient.identifierSuffix";
274
        
275
        public static final String GLOBAL_PROPERTY_PATIENT_IDENTIFIER_SEARCH_PATTERN = "patient.identifierSearchPattern";
276
        
277
        public static final String GLOBAL_PROPERTY_PATIENT_NAME_REGEX = "patient.nameValidationRegex";
278
        
279
        public static final String GLOBAL_PROPERTY_PERSON_SEARCH_MAX_RESULTS = "person.searchMaxResults";
280
        
281
        public static final int GLOBAL_PROPERTY_PERSON_SEARCH_MAX_RESULTS_DEFAULT_VALUE = 1000;
282
        
283
        public static final String GLOBAL_PROPERTY_PERSON_ATTRIBUTE_SEARCH_MATCH_MODE = "person.attributeSearchMatchMode";
284
        
285
        public static final String GLOBAL_PROPERTY_PERSON_ATTRIBUTE_SEARCH_MATCH_EXACT = "EXACT";
286
        
287
        public static final String GLOBAL_PROPERTY_PERSON_ATTRIBUTE_SEARCH_MATCH_ANYWHERE = "ANYWHERE";
288
        
289
        public static final String GLOBAL_PROPERTY_GZIP_ENABLED = "gzip.enabled";
290
        
291
        public static final String GLOBAL_PROPERTY_GZIP_ACCEPT_COMPRESSED_REQUESTS_FOR_PATHS = "gzip.acceptCompressedRequestsForPaths";
292
        
293
        public static final String GLOBAL_PROPERTY_MEDICAL_RECORD_OBSERVATIONS = "concept.medicalRecordObservations";
294
        
295
        public static final String GLOBAL_PROPERTY_PROBLEM_LIST = "concept.problemList";
296
        
297
        public static final String GLOBAL_PROPERTY_SHOW_PATIENT_NAME = "dashboard.showPatientName";
298
        
299
        public static final String GLOBAL_PROPERTY_ENABLE_VISITS = "visits.enabled";
300
        
301
        public static final String GLOBAL_PROPERTY_ALLOW_OVERLAPPING_VISITS = "visits.allowOverlappingVisits";
302
        
303
        public static final String GLOBAL_PROPERTY_DEFAULT_PATIENT_IDENTIFIER_VALIDATOR = "patient.defaultPatientIdentifierValidator";
304
        
305
        public static final String GLOBAL_PROPERTY_PATIENT_IDENTIFIER_IMPORTANT_TYPES = "patient_identifier.importantTypes";
306
        
307
        public static final String GLOBAL_PROPERTY_ENCOUNTER_FORM_OBS_SORT_ORDER = "encounterForm.obsSortOrder";
308
        
309
        public static final String GLOBAL_PROPERTY_LOCALE_ALLOWED_LIST = "locale.allowed.list";
310
        
311
        public static final String GLOBAL_PROPERTY_IMPLEMENTATION_ID = "implementation_id";
312
        
313
        public static final String GLOBAL_PROPERTY_NEWPATIENTFORM_SHOW_RELATIONSHIPS = "new_patient_form.showRelationships";
314
        
315
        public static final String GLOBAL_PROPERTY_NEWPATIENTFORM_RELATIONSHIPS = "newPatientForm.relationships";
316
        
317
        public static final String GLOBAL_PROPERTY_COMPLEX_OBS_DIR = "obs.complex_obs_dir";
318
        
319
        public static final String GLOBAL_PROPERTY_MIN_SEARCH_CHARACTERS = "minSearchCharacters";
320
        
321
        public static final int GLOBAL_PROPERTY_DEFAULT_MIN_SEARCH_CHARACTERS = 2;
322
        
323
        public static final String GLOBAL_PROPERTY_DEFAULT_LOCALE = "default_locale";
324
        
325
        public static final String GLOBAL_PROPERTY_DEFAULT_LOCATION_NAME = "default_location";
326
        
327
        public static final String GLOBAL_PROPERTY_DEFAULT_LOCALE_DEFAULT_VALUE = "en_GB";
328
        
329
        public static final String GLOBAL_PROPERTY_DEFAULT_WEEK_START_DAY = "datePicker.weekStart";
330
        
331
        public static final String GLOBAL_PROPERTY_DEFAULT_WEEK_START_DAY_DEFAULT_VALUE = "0";
332
        
333
        public static final String GLOBAL_PROPERTY_PATIENT_IDENTIFIER_SEARCH_MATCH_MODE = "patientIdentifierSearch.matchMode";
334
        
335
        public static final String GLOBAL_PROPERTY_PATIENT_SEARCH_MATCH_MODE = "patientSearch.matchMode";
336
        
337
        public static final String GLOBAL_PROPERTY_PATIENT_SEARCH_MATCH_EXACT = "EXACT";
338
        
339
        public static final String GLOBAL_PROPERTY_PATIENT_SEARCH_MATCH_ANYWHERE = "ANYWHERE";
340
        
341
        public static final String GLOBAL_PROPERTY_PATIENT_SEARCH_MATCH_START = "START";
342
        
343
        public static final String GLOBAL_PROPERTY_PATIENT_SEARCH_MATCH_SOUNDEX = "SOUNDEX";
344
        
345
        public static final String GLOBAL_PROPERTY_PROVIDER_SEARCH_MATCH_MODE = "providerSearch.matchMode";
346
        
347
        public static final String GLOBAL_PROPERTY_DEFAULT_SERIALIZER = "serialization.defaultSerializer";
348
        
349
        public static final String GLOBAL_PROPERTY_IGNORE_MISSING_NONLOCAL_PATIENTS = "hl7_processor.ignore_missing_patient_non_local";
350
        
351
        public static final String GLOBAL_PROPERTY_TRUE_CONCEPT = "concept.true";
352
        
353
        public static final String GLOBAL_PROPERTY_FALSE_CONCEPT = "concept.false";
354
        
355
        public static final String GLOBAL_PROPERTY_UNKNOWN_CONCEPT = "concept.unknown";
356
        
357
        public static final String GLOBAL_PROPERTY_LOCATION_WIDGET_TYPE = "location.field.style";
358
        
359
        public static final String GLOBAL_PROPERTY_REPORT_BUG_URL = "reportProblem.url";
360
        
361
        public static final String GLOBAL_PROPERTY_ADDRESS_TEMPLATE = "layout.address.format";
362
        
363
        public static final String GLOBAL_PROPERTY_LAYOUT_NAME_FORMAT = "layout.name.format";
364
        
365
        public static final String GLOBAL_PROPERTY_LAYOUT_NAME_TEMPLATE = "layout.name.template";
366
        
367
        public static final String GLOBAL_PROPERTY_ENCOUNTER_TYPES_LOCKED = "EncounterType.encounterTypes.locked";
368
        
369
        public static final String GLOBAL_PROPERTY_FORMS_LOCKED = "forms.locked";
370
        
371
        public static final String GLOBAL_PROPERTY_PERSON_ATRIBUTE_TYPES_LOCKED = "personAttributeTypes.locked";
372
        
373
        public static final String GLOBAL_PROPERTY_PATIENT_IDENTIFIER_TYPES_LOCKED = "patientIdentifierTypes.locked";
374
        
375
        public static final String GLOBAL_PROPERTY_DRUG_ORDER_REQUIRE_DRUG = "drugOrder.requireDrug";
376

377
        public static final String GLOBAL_PROPERTY_DRUG_ORDER_REQUIRE_OUTPATIENT_QUANTITY = "drugOrder.requireOutpatientQuantity";
378
        
379
        public static final String DEFAULT_ADDRESS_TEMPLATE = "<org.openmrs.layout.address.AddressTemplate>\n"
380
                + "    <nameMappings class=\"properties\">\n"
381
                + "      <property name=\"postalCode\" value=\"Location.postalCode\"/>\n"
382
                + "      <property name=\"address2\" value=\"Location.address2\"/>\n"
383
                + "      <property name=\"address1\" value=\"Location.address1\"/>\n"
384
                + "      <property name=\"country\" value=\"Location.country\"/>\n"
385
                + "      <property name=\"stateProvince\" value=\"Location.stateProvince\"/>\n"
386
                + "      <property name=\"cityVillage\" value=\"Location.cityVillage\"/>\n" + "    </nameMappings>\n"
387
                + "    <sizeMappings class=\"properties\">\n" + "      <property name=\"postalCode\" value=\"10\"/>\n"
388
                + "      <property name=\"address2\" value=\"40\"/>\n" + "      <property name=\"address1\" value=\"40\"/>\n"
389
                + "      <property name=\"country\" value=\"10\"/>\n"
390
                + "      <property name=\"stateProvince\" value=\"10\"/>\n"
391
                + "      <property name=\"cityVillage\" value=\"10\"/>\n" + "    </sizeMappings>\n" + "    <lineByLineFormat>\n"
392
                + "      <string>address1</string>\n" + "      <string>address2</string>\n"
393
                + "      <string>cityVillage stateProvince country postalCode</string>\n" + "    </lineByLineFormat>\n"
394
                + "   <requiredElements>\\n\" + \" </requiredElements>\\n\" + \" </org.openmrs.layout.address.AddressTemplate>";
395
        
396
        /**
397
         * Global property name that allows specification of whether user passwords must contain both
398
         * upper and lower case characters. Allowable values are "true", "false", and null
399
         */
400
        public static final String GP_PASSWORD_REQUIRES_UPPER_AND_LOWER_CASE = "security.passwordRequiresUpperAndLowerCase";
401
        
402
        /**
403
         * Global property name that allows specification of whether user passwords require non-digits.
404
         * Allowable values are "true", "false", and null
405
         */
406
        public static final String GP_PASSWORD_REQUIRES_NON_DIGIT = "security.passwordRequiresNonDigit";
407
        
408
        /**
409
         * Global property name that allows specification of whether user passwords must contain digits.
410
         * Allowable values are "true", "false", and null
411
         */
412
        public static final String GP_PASSWORD_REQUIRES_DIGIT = "security.passwordRequiresDigit";
413
        
414
        /**
415
         * Global property name that allows specification of whether user passwords can match username
416
         * or system id. Allowable values are "true", "false", and null
417
         */
418
        public static final String GP_PASSWORD_CANNOT_MATCH_USERNAME_OR_SYSTEMID = "security.passwordCannotMatchUsername";
419
        
420
        /**
421
         * Global property name that allows specification of whether user passwords have a minimum
422
         * length requirement Allowable values are any integer
423
         */
424
        public static final String GP_PASSWORD_MINIMUM_LENGTH = "security.passwordMinimumLength";
425
        
426
        /**
427
         * Global property that stores the duration for which the password reset token is valid
428
         */
429
        public static final String GP_PASSWORD_RESET_VALIDTIME = "security.validTime";
430
        
431
        /**
432
         * Global property name that allows specification of a regular expression that passwords must
433
         * adhere to
434
         */
435
        public static final String GP_PASSWORD_CUSTOM_REGEX = "security.passwordCustomRegex";
436
        
437
        /**
438
         * Global property name for absolute color for patient graphs.
439
         */
440
        public static final String GP_GRAPH_COLOR_ABSOLUTE = "graph.color.absolute";
441
        
442
        /**
443
         * Global property name for normal color for patient graphs.
444
         */
445
        public static final String GP_GRAPH_COLOR_NORMAL = "graph.color.normal";
446
        
447
        /**
448
         * Global property name for critical color for patient graphs.
449
         */
450
        public static final String GP_GRAPH_COLOR_CRITICAL = "graph.color.critical";
451
        
452
        /**
453
         * Global property name for the maximum number of search results that are returned by a single
454
         * ajax call
455
         */
456
        public static final String GP_SEARCH_WIDGET_BATCH_SIZE = "searchWidget.batchSize";
457
        
458
        /**
459
         * Global property name for the mode the search widgets should run in, this depends on the speed
460
         * of the network's connection
461
         */
462
        public static final String GP_SEARCH_WIDGET_IN_SERIAL_MODE = "searchWidget.runInSerialMode";
463
        
464
        /**
465
         * Global property name for the time interval in milliseconds between key up and triggering the
466
         * search off
467
         */
468
        public static final String GP_SEARCH_WIDGET_DELAY_INTERVAL = "searchWidget.searchDelayInterval";
469
        
470
        /**
471
         * Global property name for the maximum number of results to return from a single search in the
472
         * search widgets
473
         */
474
        public static final String GP_SEARCH_WIDGET_MAXIMUM_RESULTS = "searchWidget.maximumResults";
475
        
476
        /**
477
         * Global property for the Date format to be used to display date under search widgets and auto-completes
478
         */
479
        public static final String GP_SEARCH_DATE_DISPLAY_FORMAT = "searchWidget.dateDisplayFormat";
480
        
481
        /**
482
         * Global property name for enabling/disabling concept map type management
483
         */
484
        public static final String GP_ENABLE_CONCEPT_MAP_TYPE_MANAGEMENT = "concept_map_type_management.enable";
485
        
486
        /**
487
         * Global property name for the handler that assigns visits to encounters
488
         */
489
        public static final String GP_VISIT_ASSIGNMENT_HANDLER = "visits.assignmentHandler";
490
        
491
        /**
492
         * Global property name for mapping encounter types to visit types.
493
         */
494
        public static final String GP_ENCOUNTER_TYPE_TO_VISIT_TYPE_MAPPING = "visits.encounterTypeToVisitTypeMapping";
495
        
496
        /**
497
         * Global property name for the encounter roles to display on the provider column of the patient
498
         * dashboard under the encounters tab.
499
         */
500
        public static final String GP_DASHBOARD_PROVIDER_DISPLAY_ENCOUNTER_ROLES = "dashboard.encounters.providerDisplayRoles";
501
        
502
        /**
503
         * Global property name for optional configuration of the maximum number of encounters to
504
         * display on the encounter tab of the patient dashboard
505
         */
506
        public static final String GP_DASHBOARD_MAX_NUMBER_OF_ENCOUNTERS_TO_SHOW = "dashboard.encounters.maximumNumberToShow";
507
        
508
        /**
509
         * Global property name to display program, workflow and states in a specific case
510
         */
511
        public static final String GP_DASHBOARD_METADATA_CASE_CONVERSION = "dashboard.metadata.caseConversion";
512
        
513
        /**
514
         * Global property name for the default ConceptMapType which is set automatically when no other is set manually.
515
         */
516
        public static final String GP_DEFAULT_CONCEPT_MAP_TYPE = "concept.defaultConceptMapType";
517
        
518
        /**
519
         * Global property name of the allowed concept classes for the dosage form field of the concept drug management form.
520
         */
521
        public static final String GP_CONCEPT_DRUG_DOSAGE_FORM_CONCEPT_CLASSES = "conceptDrug.dosageForm.conceptClasses";
522
        
523
        /**
524
         * Global property name of the allowed concept classes for the route field of the concept drug management form.
525
         */
526
        public static final String GP_CONCEPT_DRUG_ROUTE_CONCEPT_CLASSES = "conceptDrug.route.conceptClasses";
527
        
528
        /**
529
         * Global property name of the allowed concept classes for the allergen field of the allergy
530
         * management form.
531
         */
532
        public static final String GP_ALLERGY_ALLERGEN_CONCEPT_CLASSES = "allergy.allergen.ConceptClasses";
533
        
534
        /**
535
         * Global property name of the allowed concept classes for the reaction field of the allergy
536
         * management form.
537
         */
538
        public static final String GP_ALLERGY_REACTION_CONCEPT_CLASSES = "allergy.reaction.ConceptClasses";
539
        
540
        /**
541
         * Global property name of other non coded allergen, stored in allergen coded allergen
542
         * when other non coded allergen is represented
543
         */
544
        public static final String GP_ALLERGEN_OTHER_NON_CODED_UUID = "allergy.concept.otherNonCoded";
545
        
546
        /**
547
         * Encryption properties; both vector and key are required to utilize a two-way encryption
548
         */
549
        public static final String ENCRYPTION_CIPHER_CONFIGURATION = "AES/CBC/PKCS5Padding";
550
        
551
        public static final String ENCRYPTION_KEY_SPEC = "AES";
552
        
553
        public static final String ENCRYPTION_VECTOR_RUNTIME_PROPERTY = "encryption.vector";
554
        
555
        public static final String ENCRYPTION_VECTOR_DEFAULT = "9wyBUNglFCRVSUhMfsTa3Q==";
556
        
557
        public static final String ENCRYPTION_KEY_RUNTIME_PROPERTY = "encryption.key";
558
        
559
        public static final String ENCRYPTION_KEY_DEFAULT = "dTfyELRrAICGDwzjHDjuhw==";
560
        
561
        /**
562
         * Global property name for the visit type(s) to automatically close
563
         */
564
        public static final String GP_VISIT_TYPES_TO_AUTO_CLOSE = "visits.autoCloseVisitType";
565
        
566
        /**
567
         * The name of the scheduled task that automatically stops the active visits
568
         */
569
        public static final String AUTO_CLOSE_VISITS_TASK_NAME = "Auto Close Visits Task";
570
        
571
        public static final String GP_ALLOWED_FAILED_LOGINS_BEFORE_LOCKOUT = "security.allowedFailedLoginsBeforeLockout";
572

573
        public static final String GP_UNLOCK_ACCOUNT_WAITING_TIME  = "security.unlockAccountWaitingTime";
574
        
575
        /**
576
         * @since 1.9.9, 1.10.2, 1.11
577
         */
578
        public static final String GP_CASE_SENSITIVE_DATABASE_STRING_COMPARISON = "search.caseSensitiveDatabaseStringComparison";
579
        
580
        public static final String GP_DASHBOARD_CONCEPTS = "dashboard.header.showConcept";
581
        
582
        public static final String GP_MAIL_SMTP_STARTTLS_ENABLE = "mail.smtp.starttls.enable";
583
        
584
        public static final String GP_NEXT_ORDER_NUMBER_SEED = "order.nextOrderNumberSeed";
585
        
586
        public static final String GP_ORDER_NUMBER_GENERATOR_BEAN_ID = "order.orderNumberGeneratorBeanId";
587

588
        /**
589
         *  @since 2.7.8, 2.8.2
590
         */
591
        public static final String GP_ALLOW_SETTING_ORDER_NUMBER = "order.allowSettingOrderNumber";
592
        
593
        /**
594
         *  @since 2.7.8, 2.8.2
595
         */
596
        public static final String GP_ALLOW_SETTING_STOP_DATE_ON_INACTIVE_ORDERS = "order.allowSettingStopDateOnInactiveOrders";
597
        
598
        /**
599
         * Specifies the uuid of the concept set where its members represent the possible drug routes
600
         */
601
        public static final String GP_DRUG_ROUTES_CONCEPT_UUID = "order.drugRoutesConceptUuid";
602
        
603
        public static final String GP_DRUG_DOSING_UNITS_CONCEPT_UUID = "order.drugDosingUnitsConceptUuid";
604
        
605
        public static final String GP_DRUG_DISPENSING_UNITS_CONCEPT_UUID = "order.drugDispensingUnitsConceptUuid";
606
        
607
        public static final String GP_DURATION_UNITS_CONCEPT_UUID = "order.durationUnitsConceptUuid";
608
        
609
        public static final String GP_TEST_SPECIMEN_SOURCES_CONCEPT_UUID = "order.testSpecimenSourcesConceptUuid";
610
        
611
        public static final String GP_UNKNOWN_PROVIDER_UUID = "provider.unknownProviderUuid";
612
        
613
        /**
614
         * @since 1.11
615
         */
616
        public static final String GP_SEARCH_INDEX_VERSION = "search.indexVersion";
617
        
618
        /**
619
         * Indicates the version of the search index. The index will be rebuilt, if the version changes.
620
         *
621
         * @since 1.11
622
         */
623
        public static final Integer SEARCH_INDEX_VERSION = 8;
1✔
624

625
        /**
626
         * @since 1.12
627
         */
628
        public static final String GP_DISABLE_VALIDATION = "validation.disable";
629

630
    /**
631
     * @since 1.12
632
         * Specifies the uuid of the concept which represents drug non coded
633
         */
634
        public static final String GP_DRUG_ORDER_DRUG_OTHER = "drugOrder.drugOther";
635

636
        /**
637
         * Global property that stores the base url for the application.
638
         * @deprecated as of 2.6.0, replaced by {@link #GP_PASSWORD_RESET_URL}
639
         */
640
        @Deprecated
641
        public static final String GP_HOST_URL = "host.url";
642
        
643
        /**
644
         * Global property that stores the base url for the password reset.
645
         */
646
        public static final String GP_PASSWORD_RESET_URL = "security.passwordResetUrl";
647

648
        /**
649
         * Global property that stores the number of days for users to be deactivated.
650
         */
651
        public static final String GP_NUMBER_OF_DAYS_TO_AUTO_RETIRE_USERS = "users.numberOfDaysToRetire";
652
        
653
        /**
654
         * At OpenMRS startup these global properties/default values/descriptions are inserted into the
655
         * database if they do not exist yet.
656
         *
657
         * @return List&lt;GlobalProperty&gt; of the core global properties
658
         */
659
        public static final List<GlobalProperty> CORE_GLOBAL_PROPERTIES() {
UNCOV
660
                List<GlobalProperty> props = new ArrayList<>();
×
661
                
UNCOV
662
                props.add(new GlobalProperty("use_patient_attribute.healthCenter", "false",
×
663
                        "Indicates whether or not the 'health center' attribute is shown when viewing/searching for patients",
664
                        BooleanDatatype.class, null));
UNCOV
665
                props.add(new GlobalProperty("use_patient_attribute.mothersName", "false",
×
666
                        "Indicates whether or not mother's name is able to be added/viewed for a patient", BooleanDatatype.class,
667
                        null));
668
                
UNCOV
669
                props.add(new GlobalProperty(GLOBAL_PROPERTY_NEWPATIENTFORM_SHOW_RELATIONSHIPS, "false",
×
670
                        "true/false whether or not to show the relationship editor on the addPatient.htm screen",
671
                        BooleanDatatype.class, null));
672
                
UNCOV
673
                props.add(new GlobalProperty("dashboard.overview.showConcepts", "",
×
674
                        "Comma delimited list of concepts ids to show on the patient dashboard overview tab"));
675
                
UNCOV
676
                props
×
677
                        .add(new GlobalProperty("dashboard.encounters.showEmptyFields", "true",
×
678
                                "true/false whether or not to show empty fields on the 'View Encounter' window",
679
                                BooleanDatatype.class, null));
UNCOV
680
                props
×
681
                        .add(new GlobalProperty(
×
682
                                "dashboard.encounters.usePages",
683
                                "smart",
684
                                "true/false/smart on how to show the pages on the 'View Encounter' window.  'smart' means that if > 50% of the fields have page numbers defined, show data in pages"));
UNCOV
685
                props.add(new GlobalProperty("dashboard.encounters.showViewLink", "true",
×
686
                        "true/false whether or not to show the 'View Encounter' link on the patient dashboard",
687
                        BooleanDatatype.class, null));
UNCOV
688
                props.add(new GlobalProperty("dashboard.encounters.showEditLink", "true",
×
689
                        "true/false whether or not to show the 'Edit Encounter' link on the patient dashboard",
690
                        BooleanDatatype.class, null));
UNCOV
691
                props
×
692
                        .add(new GlobalProperty(
×
693
                                "dashboard.header.programs_to_show",
694
                                "",
695
                                "List of programs to show Enrollment details of in the patient header. (Should be an ordered comma-separated list of program_ids or names.)"));
UNCOV
696
                props
×
697
                        .add(new GlobalProperty(
×
698
                                "dashboard.header.workflows_to_show",
699
                                "",
700
                                "List of programs to show Enrollment details of in the patient header. List of workflows to show current status of in the patient header. These will only be displayed if they belong to a program listed above. (Should be a comma-separated list of program_workflow_ids.)"));
UNCOV
701
                props.add(new GlobalProperty("dashboard.relationships.show_types", "",
×
702
                        "Types of relationships separated by commas.  Doctor/Patient,Parent/Child"));
UNCOV
703
                props.add(new GlobalProperty("FormEntry.enableDashboardTab", "true",
×
704
                        "true/false whether or not to show a Form Entry tab on the patient dashboard", BooleanDatatype.class, null));
UNCOV
705
                props.add(new GlobalProperty("FormEntry.enableOnEncounterTab", "false",
×
706
                        "true/false whether or not to show a Enter Form button on the encounters tab of the patient dashboard",
707
                        BooleanDatatype.class, null));
UNCOV
708
                props
×
709
                        .add(new GlobalProperty(
×
710
                                "dashboard.regimen.displayDrugSetIds",
711
                                "ANTIRETROVIRAL DRUGS,TUBERCULOSIS TREATMENT DRUGS",
712
                                "Drug sets that appear on the Patient Dashboard Regimen tab. Comma separated list of name of concepts that are defined as drug sets."));
713
                
UNCOV
714
                props
×
715
                        .add(new GlobalProperty(
×
716
                                GLOBAL_PROPERTY_DRUG_FREQUENCIES,
717
                                "7 days/week,6 days/week,5 days/week,4 days/week,3 days/week,2 days/week,1 days/week",
718
                                "Frequency of a drug order that appear on the Patient Dashboard. Comma separated list of name of concepts that are defined as drug frequencies."));
719
                
UNCOV
720
                props.add(new GlobalProperty(GP_GRAPH_COLOR_ABSOLUTE, "rgb(20,20,20)",
×
721
                        "Color of the 'invalid' section of numeric graphs on the patient dashboard."));
722
                
UNCOV
723
                props.add(new GlobalProperty(GP_GRAPH_COLOR_NORMAL, "rgb(255,126,0)",
×
724
                        "Color of the 'normal' section of numeric graphs on the patient dashboard."));
725
                
UNCOV
726
                props.add(new GlobalProperty(GP_GRAPH_COLOR_CRITICAL, "rgb(200,0,0)",
×
727
                        "Color of the 'critical' section of numeric graphs on the patient dashboard."));
728
                
UNCOV
729
                props.add(new GlobalProperty(GLOBAL_PROPERTY_LOCATION_WIDGET_TYPE, "default",
×
730
                        "Type of widget to use for location fields"));
731
                
UNCOV
732
                props.add(new GlobalProperty(GP_MAIL_SMTP_STARTTLS_ENABLE, "false",
×
733
                        "Set to true to enable TLS encryption, else set to false"));
734

UNCOV
735
                props.add(new GlobalProperty(GP_PASSWORD_RESET_URL, "",
×
736
                        "The URL to redirect to after requesting for a password reset. Always provide a place holder in this url with name {activationKey}, it will get substituted by the actual activation key."));
737
                
UNCOV
738
                props.add(new GlobalProperty("mail.transport_protocol", "smtp",
×
739
                        "Transport protocol for the messaging engine. Valid values: smtp"));
UNCOV
740
                props.add(new GlobalProperty("mail.smtp_host", "localhost", "SMTP host name"));
×
741
                props.add(new GlobalProperty("mail.smtp_port", "25", "SMTP port"));
×
742
                props.add(new GlobalProperty("mail.from", "info@openmrs.org", "Email address to use as the default from address"));
×
743
                props.add(new GlobalProperty("mail.debug", "false",
×
744
                        "true/false whether to print debugging information during mailing"));
UNCOV
745
                props.add(new GlobalProperty("mail.smtp_auth", "false", "true/false whether the smtp host requires authentication"));
×
746
                props.add(new GlobalProperty("mail.user", "test", "Username of the SMTP user (if smtp_auth is enabled)"));
×
747
                props.add(new GlobalProperty("mail.password", "test", "Password for the SMTP user (if smtp_auth is enabled)"));
×
748
                props.add(new GlobalProperty("mail.default_content_type", "text/plain",
×
749
                        "Content type to append to the mail messages"));
750
                
UNCOV
751
                props.add(new GlobalProperty(ModuleConstants.REPOSITORY_FOLDER_PROPERTY,
×
752
                        ModuleConstants.REPOSITORY_FOLDER_PROPERTY_DEFAULT, "Name of the folder in which to store the modules"));
UNCOV
753
                props.add(new GlobalProperty(GLOBAL_PROPERTY_ADDRESS_TEMPLATE, DEFAULT_ADDRESS_TEMPLATE,
×
754
                        "XML description of address formats"));
UNCOV
755
                props.add(new GlobalProperty(GLOBAL_PROPERTY_LAYOUT_NAME_FORMAT, PERSON_NAME_FORMAT_SHORT,
×
756
                        "Format in which to display the person names.  Valid values are short, long"));
757
                
UNCOV
758
                props.add(new GlobalProperty(GLOBAL_PROPERTY_CONCEPTS_LOCKED, "false", "if true, do not allow editing concepts",
×
759
                        BooleanDatatype.class, null));
760
                
UNCOV
761
                props.add(new GlobalProperty(GLOBAL_PROPERTY_PATIENT_LISTING_ATTRIBUTES, "",
×
762
                        "A comma delimited list of PersonAttributeType names that should be displayed for patients in _lists_"));
UNCOV
763
                props
×
UNCOV
764
                        .add(new GlobalProperty(GLOBAL_PROPERTY_PATIENT_VIEWING_ATTRIBUTES, "",
×
765
                                "A comma delimited list of PersonAttributeType names that should be displayed for patients when _viewing individually_"));
UNCOV
766
                props.add(new GlobalProperty(GLOBAL_PROPERTY_PATIENT_HEADER_ATTRIBUTES, "",
×
767
                        "A comma delimited list of PersonAttributeType names that will be shown on the patient dashboard"));
768
                
UNCOV
769
                props.add(new GlobalProperty(GLOBAL_PROPERTY_USER_LISTING_ATTRIBUTES, "",
×
770
                        "A comma delimited list of PersonAttributeType names that should be displayed for users in _lists_"));
771
                props
×
UNCOV
772
                        .add(new GlobalProperty(GLOBAL_PROPERTY_USER_VIEWING_ATTRIBUTES, "",
×
773
                                "A comma delimited list of PersonAttributeType names that should be displayed for users when _viewing individually_"));
UNCOV
774
                props
×
UNCOV
775
                        .add(new GlobalProperty(GLOBAL_PROPERTY_USER_HEADER_ATTRIBUTES, "",
×
776
                                "A comma delimited list of PersonAttributeType names that will be shown on the user dashboard. (not used in v1.5)"));
777
                
778
                props
×
779
                        .add(new GlobalProperty(
×
780
                                GLOBAL_PROPERTY_PATIENT_IDENTIFIER_REGEX,
781
                                "",
782
                                "WARNING: Using this search property can cause a drop in mysql performance with large patient sets.  A MySQL regular expression for the patient identifier search strings.  The @SEARCH@ string is replaced at runtime with the user's search string.  An empty regex will cause a simply 'like' sql search to be used. Example: ^0*@SEARCH@([A-Z]+-[0-9])?$"));
UNCOV
783
                props
×
UNCOV
784
                        .add(new GlobalProperty(
×
785
                                GLOBAL_PROPERTY_PATIENT_IDENTIFIER_PREFIX,
786
                                "",
787
                                "This property is only used if "
788
                                        + GLOBAL_PROPERTY_PATIENT_IDENTIFIER_REGEX
789
                                        + " is empty.  The string here is prepended to the sql indentifier search string.  The sql becomes \"... where identifier like '<PREFIX><QUERY STRING><SUFFIX>';\".  Typically this value is either a percent sign (%) or empty."));
790
                props
×
791
                        .add(new GlobalProperty(
×
792
                                GLOBAL_PROPERTY_PATIENT_IDENTIFIER_SUFFIX,
793
                                "",
794
                                "This property is only used if "
795
                                        + GLOBAL_PROPERTY_PATIENT_IDENTIFIER_REGEX
796
                                        + " is empty.  The string here is prepended to the sql indentifier search string.  The sql becomes \"... where identifier like '<PREFIX><QUERY STRING><SUFFIX>';\".  Typically this value is either a percent sign (%) or empty."));
797
                props
×
798
                        .add(new GlobalProperty(
×
799
                                GLOBAL_PROPERTY_PATIENT_IDENTIFIER_SEARCH_PATTERN,
800
                                "",
801
                                "If this is empty, the regex or suffix/prefix search is used.  Comma separated list of identifiers to check.  Allows for faster searching of multiple options rather than the slow regex. e.g. @SEARCH@,0@SEARCH@,@SEARCH-1@-@CHECKDIGIT@,0@SEARCH-1@-@CHECKDIGIT@ would turn a request for \"4127\" into a search for \"in ('4127','04127','412-7','0412-7')\""));
802
                
UNCOV
803
                props
×
804
                        .add(new GlobalProperty(
×
805
                                GLOBAL_PROPERTY_PATIENT_NAME_REGEX,
806
                                "",
807
                                "Names of the patients must pass this regex. Eg : ^[a-zA-Z \\-]+$ contains only english alphabet letters, spaces, and hyphens. A value of .* or the empty string means no validation is done."));
808
                
UNCOV
809
                props.add(new GlobalProperty(GLOBAL_PROPERTY_PERSON_SEARCH_MAX_RESULTS, String
×
810
                        .valueOf(GLOBAL_PROPERTY_PERSON_SEARCH_MAX_RESULTS_DEFAULT_VALUE),
×
811
                        "The maximum number of results returned by patient searches"));
812
                
UNCOV
813
                props
×
UNCOV
814
                        .add(new GlobalProperty(
×
815
                                GLOBAL_PROPERTY_GZIP_ENABLED,
816
                                "false",
817
                                "Set to 'true' to turn on OpenMRS's gzip filter, and have the webapp compress data before sending it to any client that supports it. Generally use this if you are running Tomcat standalone. If you are running Tomcat behind Apache, then you'd want to use Apache to do gzip compression.",
818
                                BooleanDatatype.class, null));
819
                
820
        
821
                props
×
UNCOV
822
                        .add(new GlobalProperty(
×
823
                                GLOBAL_PROPERTY_LOG_LEVEL,
824
                                "org.openmrs.api:" + LOG_LEVEL_INFO,
825
                                "Logging levels for log4j2.xml. Valid format is class:level,class:level. If class not specified, 'org.openmrs.api' presumed. Valid levels are trace, debug, info, warn, error or fatal"));
826
                
UNCOV
827
                props.add(new GlobalProperty(GP_LOG_LOCATION, "",
×
828
                        "A directory where the OpenMRS log file appender is stored. The log file name is 'openmrs.log'."));
829
                
UNCOV
830
                props.add(new GlobalProperty(GP_LOG_LAYOUT, "%p - %C{1}.%M(%L) |%d{ISO8601}| %m%n",
×
831
                        "A log layout pattern which is used by the OpenMRS file appender."));
832
                
UNCOV
833
                props
×
834
                        .add(new GlobalProperty(
×
835
                                GLOBAL_PROPERTY_DEFAULT_PATIENT_IDENTIFIER_VALIDATOR,
836
                                LUHN_IDENTIFIER_VALIDATOR,
837
                                "This property sets the default patient identifier validator.  The default validator is only used in a handful of (mostly legacy) instances.  For example, it's used to generate the isValidCheckDigit calculated column and to append the string \"(default)\" to the name of the default validator on the editPatientIdentifierType form."));
838
                
UNCOV
839
                props
×
840
                        .add(new GlobalProperty(
×
841
                                GLOBAL_PROPERTY_PATIENT_IDENTIFIER_IMPORTANT_TYPES,
842
                                "",
843
                                "A comma delimited list of PatientIdentifier names : PatientIdentifier locations that will be displayed on the patient dashboard.  E.g.: TRACnet ID:Rwanda,ELDID:Kenya"));
844
                
UNCOV
845
                props.add(new GlobalProperty(GLOBAL_PROPERTY_COMPLEX_OBS_DIR, "complex_obs",
×
846
                        "Default directory for storing complex obs."));
847
                
UNCOV
848
                props
×
UNCOV
849
                        .add(new GlobalProperty(
×
850
                                GLOBAL_PROPERTY_ENCOUNTER_FORM_OBS_SORT_ORDER,
851
                                "number",
852
                                "The sort order for the obs listed on the encounter edit form.  'number' sorts on the associated numbering from the form schema.  'weight' sorts on the order displayed in the form schema."));
853
                
UNCOV
854
                props.add(new GlobalProperty(GLOBAL_PROPERTY_LOCALE_ALLOWED_LIST, "en, en_GB, es, fr, it, pt",
×
855
                        "Comma delimited list of locales allowed for use on system"));
856
                
UNCOV
857
                props
×
UNCOV
858
                        .add(new GlobalProperty(
×
859
                                GLOBAL_PROPERTY_NEWPATIENTFORM_RELATIONSHIPS,
860
                                "",
861
                                "Comma separated list of the RelationshipTypes to show on the new/short patient form.  The list is defined like '3a, 4b, 7a'.  The number is the RelationshipTypeId and the 'a' vs 'b' part is which side of the relationship is filled in by the user."));
862
                
UNCOV
863
                props.add(new GlobalProperty(GLOBAL_PROPERTY_MIN_SEARCH_CHARACTERS, "2",
×
864
                        "Number of characters user must input before searching is started."));
865
                
UNCOV
866
                props
×
UNCOV
867
                        .add(new GlobalProperty(
×
868
                                OpenmrsConstants.GLOBAL_PROPERTY_DEFAULT_LOCALE,
869
                                OpenmrsConstants.GLOBAL_PROPERTY_DEFAULT_LOCALE_DEFAULT_VALUE,
870
                                "Specifies the default locale. You can specify both the language code(ISO-639) and the country code(ISO-3166), e.g. 'en_GB' or just country: e.g. 'en'"));
871
                
UNCOV
872
                props.add(new GlobalProperty(OpenmrsConstants.GLOBAL_PROPERTY_DEFAULT_WEEK_START_DAY,
×
873
                        OpenmrsConstants.GLOBAL_PROPERTY_DEFAULT_WEEK_START_DAY_DEFAULT_VALUE,
874
                        "First day of the week in the date picker. Domingo/Dimanche/Sunday:0  Lunes/Lundi/Monday:1"));
875
                
UNCOV
876
                props.add(new GlobalProperty(GP_PASSWORD_CANNOT_MATCH_USERNAME_OR_SYSTEMID, "true",
×
877
                        "Configure whether passwords must not match user's username or system id", BooleanDatatype.class, null));
878
                
879
                props.add(new GlobalProperty(GP_PASSWORD_CUSTOM_REGEX, "",
×
880
                        "Configure a custom regular expression that a password must match"));
881
                
UNCOV
882
                props.add(new GlobalProperty(GP_PASSWORD_MINIMUM_LENGTH, "8",
×
883
                        "Configure the minimum length required of all passwords"));
884
                
UNCOV
885
                props.add(new GlobalProperty(GP_PASSWORD_RESET_VALIDTIME, "600000",
×
886
                        " Specifies the duration of time in seconds for which a password reset token is valid, the default value is 10 minutes and the allowed values range from 1 minute to 12hrs"));
887
                
UNCOV
888
                props.add(new GlobalProperty(GP_PASSWORD_REQUIRES_DIGIT, "true",
×
889
                        "Configure whether passwords must contain at least one digit", BooleanDatatype.class, null));
890
                
UNCOV
891
                props.add(new GlobalProperty(GP_PASSWORD_REQUIRES_NON_DIGIT, "true",
×
892
                        "Configure whether passwords must contain at least one non-digit", BooleanDatatype.class, null));
893
                
UNCOV
894
                props
×
895
                        .add(new GlobalProperty(GP_PASSWORD_REQUIRES_UPPER_AND_LOWER_CASE, "true",
×
896
                                "Configure whether passwords must contain both upper and lower case characters",
897
                                BooleanDatatype.class, null));
898
                
UNCOV
899
                props.add(new GlobalProperty(GLOBAL_PROPERTY_IGNORE_MISSING_NONLOCAL_PATIENTS, "false",
×
900
                        "If true, hl7 messages for patients that are not found and are non-local will silently be dropped/ignored",
901
                        BooleanDatatype.class, null));
902
                
UNCOV
903
                props
×
UNCOV
904
                        .add(new GlobalProperty(
×
905
                                GLOBAL_PROPERTY_SHOW_PATIENT_NAME,
906
                                "false",
907
                                "Whether or not to display the patient name in the patient dashboard title. Note that enabling this could be security risk if multiple users operate on the same computer.",
908
                                BooleanDatatype.class, null));
909
                
910
                props.add(new GlobalProperty(GLOBAL_PROPERTY_DEFAULT_THEME, "",
×
911
                        "Default theme for users.  OpenMRS ships with themes of 'green', 'orange', 'purple', and 'legacy'"));
912
                
UNCOV
913
                props.add(new GlobalProperty(GLOBAL_PROPERTY_HL7_ARCHIVE_DIRECTORY, HL7Constants.HL7_ARCHIVE_DIRECTORY_NAME,
×
914
                        "The default name or absolute path for the folder where to write the hl7_in_archives."));
915
                
UNCOV
916
                props.add(new GlobalProperty(GLOBAL_PROPERTY_REPORT_BUG_URL, "http://errors.openmrs.org/scrap",
×
917
                        "The openmrs url where to submit bug reports"));
918
                
UNCOV
919
                props.add(new GlobalProperty(GP_SEARCH_WIDGET_BATCH_SIZE, "200",
×
920
                        "The maximum number of search results that are returned by an ajax call"));
921
                
UNCOV
922
                props
×
923
                        .add(new GlobalProperty(
×
924
                                GP_SEARCH_WIDGET_IN_SERIAL_MODE,
925
                                "false",
926
                                "Specifies whether the search widgets should make ajax requests in serial or parallel order, a value of true is appropriate for implementations running on a slow network connection and vice versa",
927
                                BooleanDatatype.class, null));
928
                
929
                props
×
930
                        .add(new GlobalProperty(
×
931
                                GP_SEARCH_WIDGET_DELAY_INTERVAL,
932
                                "300",
933
                                "Specifies time interval in milliseconds when searching, between keyboard keyup event and triggering the search off, should be higher if most users are slow when typing so as to minimise the load on the server"));
934
                
UNCOV
935
                props
×
936
                        .add(new GlobalProperty(GP_SEARCH_DATE_DISPLAY_FORMAT, null,
×
937
                                "Date display format to be used to display the date somewhere in the UI i.e the search widgets and autocompletes"));
938
                
UNCOV
939
                props.add(new GlobalProperty(GLOBAL_PROPERTY_DEFAULT_LOCATION_NAME, "Unknown Location",
×
940
                        "The name of the location to use as a system default"));
UNCOV
941
                props
×
942
                                .add(new GlobalProperty(
×
943
                                                GLOBAL_PROPERTY_PATIENT_IDENTIFIER_SEARCH_MATCH_MODE,
944
                                                GLOBAL_PROPERTY_PATIENT_SEARCH_MATCH_EXACT,
945
                                                "Specifies how patient identifiers are matched while searching for a patient. Valid values are 'EXACT, 'ANYWHERE' or 'START'. Defaults to 'EXACT' if missing or invalid value is present."));
946
                
UNCOV
947
                props
×
948
                        .add(new GlobalProperty(
×
949
                                GLOBAL_PROPERTY_PATIENT_SEARCH_MATCH_MODE,
950
                                GLOBAL_PROPERTY_PATIENT_SEARCH_MATCH_START,
951
                                "Specifies how patient names are matched while searching patient. Valid values are 'ANYWHERE' or 'START'. Defaults to start if missing or invalid value is present."));
952
                
UNCOV
953
                props.add(new GlobalProperty(GP_ENABLE_CONCEPT_MAP_TYPE_MANAGEMENT, "false",
×
954
                        "Enables or disables management of concept map types", BooleanDatatype.class, null));
955
                
UNCOV
956
                props
×
UNCOV
957
                        .add(new GlobalProperty(
×
958
                                GLOBAL_PROPERTY_ENABLE_VISITS,
959
                                "true",
960
                                "Set to true to enable the Visits feature. This will replace the 'Encounters' tab with a 'Visits' tab on the dashboard.",
961
                                BooleanDatatype.class, null));
962
                
963
                props.add(new GlobalProperty(GP_VISIT_ASSIGNMENT_HANDLER, ExistingVisitAssignmentHandler.class.getName(),
×
964
                        "Set to the name of the class responsible for assigning encounters to visits."));
965
                
UNCOV
966
                props.add(new GlobalProperty(GLOBAL_PROPERTY_APPLICATION_NAME, "OpenMRS",
×
967
                        "The name of this application, as presented to the user, for example on the login and welcome pages."));
968
                
UNCOV
969
                props
×
970
                        .add(new GlobalProperty(
×
971
                                GP_ENCOUNTER_TYPE_TO_VISIT_TYPE_MAPPING,
972
                                "",
973
                                "Specifies how encounter types are mapped to visit types when automatically assigning encounters to visits. e.g 1:1, 2:1, 3:2 in the format encounterTypeId:visitTypeId or encounterTypeUuid:visitTypeUuid or a combination of encounter/visit type uuids and ids e.g 1:759799ab-c9a5-435e-b671-77773ada74e4"));
974
                
UNCOV
975
                props.add(new GlobalProperty(GLOBAL_PROPERTY_ENCOUNTER_TYPES_LOCKED, "false",
×
976
                        "saving, retiring or deleting an Encounter Type is not permitted, if true", BooleanDatatype.class, null));
977
                
UNCOV
978
                props
×
UNCOV
979
                        .add(new GlobalProperty(
×
980
                                GP_DASHBOARD_PROVIDER_DISPLAY_ENCOUNTER_ROLES,
981
                                "",
982
                                "A comma-separated list of encounter roles (by name or id). Providers with these roles in an encounter will be displayed on the encounter tab of the patient dashboard."));
983
                
UNCOV
984
                props.add(new GlobalProperty(GP_SEARCH_WIDGET_MAXIMUM_RESULTS, "2000",
×
985
                        "Specifies the maximum number of results to return from a single search in the search widgets"));
986
                
UNCOV
987
                props
×
UNCOV
988
                        .add(new GlobalProperty(
×
989
                                GP_DASHBOARD_MAX_NUMBER_OF_ENCOUNTERS_TO_SHOW,
990
                                "3",
991
                                "An integer which, if specified, would determine the maximum number of encounters to display on the encounter tab of the patient dashboard."));
992
                
UNCOV
993
                props.add(new GlobalProperty(GP_VISIT_TYPES_TO_AUTO_CLOSE, "",
×
994
                        "comma-separated list of the visit type(s) to automatically close"));
995
                
UNCOV
996
                props.add(new GlobalProperty(GP_ALLOWED_FAILED_LOGINS_BEFORE_LOCKOUT, "7",
×
997
                        "Maximum number of failed logins allowed after which username is locked out"));
998

UNCOV
999
                props.add(new GlobalProperty(GP_UNLOCK_ACCOUNT_WAITING_TIME, "5",
×
1000
                        "Waiting time for account to get automatically unlocked after getting locked due to multiple invalid login tries"));
1001

UNCOV
1002
                props.add(new GlobalProperty(GP_DEFAULT_CONCEPT_MAP_TYPE, "NARROWER-THAN",
×
1003
                        "Default concept map type which is used when no other is set"));
1004
                
UNCOV
1005
                props
×
1006
                        .add(new GlobalProperty(GP_CONCEPT_DRUG_DOSAGE_FORM_CONCEPT_CLASSES, "",
×
1007
                                "A comma-separated list of the allowed concept classes for the dosage form field of the concept drug management form."));
1008
                
1009
                props
×
UNCOV
1010
                        .add(new GlobalProperty(GP_CONCEPT_DRUG_ROUTE_CONCEPT_CLASSES, "",
×
1011
                                "A comma-separated list of the allowed concept classes for the route field of the concept drug management form."));
1012
                
1013
                props
×
UNCOV
1014
                        .add(new GlobalProperty(
×
1015
                                GP_CASE_SENSITIVE_DATABASE_STRING_COMPARISON,
1016
                                "false",
1017
                                "Indicates whether database string comparison is case sensitive or not. Setting this to false for MySQL with a case insensitive collation improves search performance."));
UNCOV
1018
                props
×
UNCOV
1019
                        .add(new GlobalProperty(
×
1020
                                GP_DASHBOARD_METADATA_CASE_CONVERSION,
1021
                                "",
1022
                                "Indicates which type automatic case conversion is applied to program/workflow/state in the patient dashboard. Valid values: lowercase, uppercase, capitalize. If empty no conversion is applied."));
1023
                
UNCOV
1024
                props.add(new GlobalProperty(GP_ALLERGY_ALLERGEN_CONCEPT_CLASSES, "Drug,MedSet",
×
1025
                        "A comma-separated list of the allowed concept classes for the allergen field of the allergy dialog"));
1026
                
UNCOV
1027
                props.add(new GlobalProperty(GP_ALLERGY_REACTION_CONCEPT_CLASSES, "Symptom",
×
1028
                        "A comma-separated list of the allowed concept classes for the reaction field of the allergy dialog"));
1029
                
UNCOV
1030
                props.add(new GlobalProperty(GLOBAL_PROPERTY_USER_REQUIRE_EMAIL_AS_USERNAME, "false",
×
1031
                        "Indicates whether a username must be a valid e-mail or not.", BooleanDatatype.class, null));
1032
                
UNCOV
1033
                props.add(new GlobalProperty(GP_SEARCH_INDEX_VERSION, "",
×
1034
                        "Indicates the index version. If it is blank, the index needs to be rebuilt."));
1035
                
UNCOV
1036
                props.add(new GlobalProperty(GLOBAL_PROPERTY_ALLOW_OVERLAPPING_VISITS, "true",
×
1037
                        "true/false whether or not to allow visits of a given patient to overlap", BooleanDatatype.class, null));
1038
                
UNCOV
1039
                props.add(new GlobalProperty(GLOBAL_PROPERTY_FORMS_LOCKED, "false",
×
1040
                        "Set to a value of true if you do not want any changes to be made on forms, else set to false."));
1041
                
UNCOV
1042
                props.add(new GlobalProperty(GLOBAL_PROPERTY_DRUG_ORDER_REQUIRE_DRUG, "false",
×
1043
                        "Set to value true if you need to specify a formulation(Drug) when creating a drug order."));
1044

UNCOV
1045
                props.add(new GlobalProperty(GLOBAL_PROPERTY_DRUG_ORDER_REQUIRE_OUTPATIENT_QUANTITY, "true",
×
1046
                        "true/false whether to require quantity, quantityUnits, and numRefills for outpatient drug orders"));
1047
                
UNCOV
1048
                props.add(new GlobalProperty(GLOBAL_PROPERTY_PERSON_ATRIBUTE_TYPES_LOCKED, "false",
×
1049
                        "Set to a value of true if you do not want allow editing person attribute types, else set to false."));
1050
                
UNCOV
1051
                props.add(new GlobalProperty(GLOBAL_PROPERTY_PATIENT_IDENTIFIER_TYPES_LOCKED, "false",
×
1052
                        "Set to a value of true if you do not want allow editing patient identifier types, else set to false."));
1053
                
UNCOV
1054
                props.add(new GlobalProperty(GP_NEXT_ORDER_NUMBER_SEED, "1", "The next order number available for assignment"));
×
1055
                
UNCOV
1056
                props.add(new GlobalProperty(GP_ORDER_NUMBER_GENERATOR_BEAN_ID, "",
×
1057
                        "Specifies spring bean id of the order generator to use when assigning order numbers"));
1058

UNCOV
1059
                props.add(new GlobalProperty(GP_ALLOW_SETTING_ORDER_NUMBER, "false",
×
1060
                        "Specifies whether the order number property on an order can be set. If false, the order number must be generated by an order number generator."));
1061
                
UNCOV
1062
                props.add(new GlobalProperty(GP_ALLOW_SETTING_STOP_DATE_ON_INACTIVE_ORDERS, "false", "Allow setting a stop date on an order that is already inactive. May be necessary when importing orders from another system."));
×
1063
                
UNCOV
1064
                props.add(new GlobalProperty(GP_DRUG_ROUTES_CONCEPT_UUID, "",
×
1065
                        "Specifies the uuid of the concept set where its members represent the possible drug routes"));
1066
                
UNCOV
1067
                props.add(new GlobalProperty(GP_DRUG_DOSING_UNITS_CONCEPT_UUID, "",
×
1068
                        "Specifies the uuid of the concept set where its members represent the possible drug dosing units"));
1069
                
UNCOV
1070
                props.add(new GlobalProperty(GP_DRUG_DISPENSING_UNITS_CONCEPT_UUID, "",
×
1071
                        "Specifies the uuid of the concept set where its members represent the possible drug dispensing units"));
1072
                
UNCOV
1073
                props.add(new GlobalProperty(GP_DURATION_UNITS_CONCEPT_UUID, "",
×
1074
                        "Specifies the uuid of the concept set where its members represent the possible duration units"));
1075
                
UNCOV
1076
                props.add(new GlobalProperty(GP_TEST_SPECIMEN_SOURCES_CONCEPT_UUID, "",
×
1077
                        "Specifies the uuid of the concept set where its members represent the possible test specimen sources"));
1078
                
UNCOV
1079
                props.add(new GlobalProperty(GP_UNKNOWN_PROVIDER_UUID, "", "Specifies the uuid of the Unknown Provider account"));
×
1080
                
UNCOV
1081
                props
×
UNCOV
1082
                        .add(new GlobalProperty(
×
1083
                                GLOBAL_PROPERTY_PROVIDER_SEARCH_MATCH_MODE,
1084
                                "EXACT",
1085
                                "Specifies how provider identifiers are matched while searching for providers. Valid values are START,EXACT, END or ANYWHERE"));
1086
                
UNCOV
1087
                props
×
1088
                        .add(new GlobalProperty(
×
1089
                                GLOBAL_PROPERTY_PERSON_ATTRIBUTE_SEARCH_MATCH_MODE,
1090
                                GLOBAL_PROPERTY_PERSON_ATTRIBUTE_SEARCH_MATCH_EXACT,
1091
                                "Specifies how person attributes are matched while searching person. Valid values are 'ANYWHERE' or 'EXACT'. Defaults to exact if missing or invalid value is present."));
1092

UNCOV
1093
                props.add(new GlobalProperty(GP_DISABLE_VALIDATION, "false",
×
1094
                                "Disables validation of OpenMRS Objects. Only takes affect on next restart. Warning: only do this is you know what you are doing!"));
1095

1096

UNCOV
1097
                props.add(new GlobalProperty("allergy.concept.severity.mild", "1498AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
×
1098
                        "UUID for the MILD severity concept"));
1099
                
1100
                props.add(new GlobalProperty("allergy.concept.severity.moderate", "1499AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
×
1101
                        "UUID for the MODERATE severity concept"));
1102
                
UNCOV
1103
                props.add(new GlobalProperty("allergy.concept.severity.severe", "1500AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
×
1104
                        "UUID for the SEVERE severity concept"));
1105
                
UNCOV
1106
                props.add(new GlobalProperty("allergy.concept.allergen.food", "162553AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
×
1107
                        "UUID for the food allergens concept"));
1108
                
UNCOV
1109
                props.add(new GlobalProperty("allergy.concept.allergen.drug", "162552AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
×
1110
                        "UUID for the drug allergens concept"));
1111
                
UNCOV
1112
                props.add(new GlobalProperty("allergy.concept.allergen.environment", "162554AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
×
1113
                        "UUID for the environment allergens concept"));
1114
                
UNCOV
1115
                props.add(new GlobalProperty("allergy.concept.reactions", "162555AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
×
1116
                        "UUID for the allergy reactions concept"));
1117
                
UNCOV
1118
                props.add(new GlobalProperty(GP_ALLERGEN_OTHER_NON_CODED_UUID, "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
×
1119
                        "UUID for the allergy other non coded concept"));
1120
                
UNCOV
1121
                props.add(new GlobalProperty("allergy.concept.unknown", "1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
×
1122
                        "UUID for the allergy unknown concept"));
1123
                
UNCOV
1124
                props
×
1125
                                .add(new GlobalProperty(GP_DRUG_ORDER_DRUG_OTHER, "", "Specifies the uuid of the concept which represents drug other non coded"));
×
UNCOV
1126
                props.add(new GlobalProperty(GP_LOGIN_URL, LOGIN_URL,
×
1127
                        "Responsible for defining the Authentication URL "));
1128
                props.addAll(ModuleFactory.getGlobalProperties());
×
1129
                
UNCOV
1130
                return props;
×
1131
        }
1132
        
1133
        // ConceptProposal proposed concept identifier keyword
1134
        public static final String PROPOSED_CONCEPT_IDENTIFIER = "PROPOSED";
1135
        
1136
        // ConceptProposal states
1137
        public static final String CONCEPT_PROPOSAL_UNMAPPED = "UNMAPPED";
1138
        
1139
        public static final String CONCEPT_PROPOSAL_CONCEPT = "CONCEPT";
1140
        
1141
        public static final String CONCEPT_PROPOSAL_SYNONYM = "SYNONYM";
1142
        
1143
        public static final String CONCEPT_PROPOSAL_REJECT = "REJECT";
1144
        
1145
        public static final Collection<String> CONCEPT_PROPOSAL_STATES() {
UNCOV
1146
                Collection<String> states = new ArrayList<>();
×
1147
                
UNCOV
1148
                states.add(CONCEPT_PROPOSAL_UNMAPPED);
×
UNCOV
1149
                states.add(CONCEPT_PROPOSAL_CONCEPT);
×
UNCOV
1150
                states.add(CONCEPT_PROPOSAL_SYNONYM);
×
UNCOV
1151
                states.add(CONCEPT_PROPOSAL_REJECT);
×
1152
                
1153
                return states;
×
1154
        }
1155
        
1156
        public static final Locale SPANISH_LANGUAGE = new Locale("es");
1✔
1157
        
1158
        public static final Locale PORTUGUESE_LANGUAGE = new Locale("pt");
1✔
1159
        
1160
        public static final Locale ITALIAN_LANGUAGE = new Locale("it");
1✔
1161
        
1162
        /*
1163
         * User property names
1164
         */
1165
        public static final String USER_PROPERTY_CHANGE_PASSWORD = "forcePassword";
1166
        
1167
        public static final String USER_PROPERTY_DEFAULT_LOCALE = "defaultLocale";
1168
        
1169
        public static final String USER_PROPERTY_DEFAULT_LOCATION = "defaultLocation";
1170
        
1171
        public static final String USER_PROPERTY_SHOW_RETIRED = "showRetired";
1172
        
1173
        public static final String USER_PROPERTY_SHOW_VERBOSE = "showVerbose";
1174
        
1175
        public static final String USER_PROPERTY_NOTIFICATION = "notification";
1176
        
1177
        public static final String USER_PROPERTY_NOTIFICATION_ADDRESS = "notificationAddress";
1178
        
1179
        public static final String USER_PROPERTY_NOTIFICATION_FORMAT = "notificationFormat"; // text/plain, text/html
1180
        
1181
        /**
1182
         * Name of the user_property that stores the number of unsuccessful login attempts this user has
1183
         * made
1184
         */
1185
        public static final String USER_PROPERTY_LOGIN_ATTEMPTS = "loginAttempts";
1186
        
1187
        /**
1188
         * Name of the user_property that stores the time the user was locked out due to too many login
1189
         * attempts
1190
         */
1191
        public static final String USER_PROPERTY_LOCKOUT_TIMESTAMP = "lockoutTimestamp";
1192
        
1193
        /**
1194
         * A user property name. The value should be a comma-separated ordered list of fully qualified
1195
         * locales within which the user is a proficient speaker. The list should be ordered from the
1196
         * most to the least proficiency. Example:
1197
         * <code>proficientLocales = en_US, en_GB, en, fr_RW</code>
1198
         */
1199
        public static final String USER_PROPERTY_PROFICIENT_LOCALES = "proficientLocales";
1200

1201
        /**
1202
          * Name of the user_property that stores user's last login time
1203
         */
1204
        public static final String USER_PROPERTY_LAST_LOGIN_TIMESTAMP = "lastLoginTimestamp";
1205
        
1206
        // Used for differences between windows/linux upload capabilities)
1207
        // Used for determining where to find runtime properties
1208
        public static final String OPERATING_SYSTEM_KEY = "os.name";
1209
        
1210
        public static final String OPERATING_SYSTEM = System.getProperty(OPERATING_SYSTEM_KEY);
1✔
1211
        
1212
        public static final String OPERATING_SYSTEM_WINDOWS_XP = "Windows XP";
1213
        
1214
        public static final String OPERATING_SYSTEM_WINDOWS_VISTA = "Windows Vista";
1215
        
1216
        public static final String OPERATING_SYSTEM_LINUX = "Linux";
1217
        
1218
        public static final String OPERATING_SYSTEM_SUNOS = "SunOS";
1219
        
1220
        public static final String OPERATING_SYSTEM_FREEBSD = "FreeBSD";
1221
        
1222
        public static final String OPERATING_SYSTEM_OSX = "Mac OS X";
1223
        
1224
        /**
1225
         * URL to the concept source id verification server
1226
         */
1227
        public static final String IMPLEMENTATION_ID_REMOTE_CONNECTION_URL = "https://implementation.openmrs.org";
1228
        
1229
        /**
1230
         * Shortcut booleans used to make some OS specific checks more generic; note the *nix flavored
1231
         * check is missing some less obvious choices
1232
         */
1233
        public static final boolean UNIX_BASED_OPERATING_SYSTEM = (OPERATING_SYSTEM.contains(OPERATING_SYSTEM_LINUX)
1✔
UNCOV
1234
                || OPERATING_SYSTEM.contains(OPERATING_SYSTEM_SUNOS)
×
1235
                || OPERATING_SYSTEM.contains(OPERATING_SYSTEM_FREEBSD) || OPERATING_SYSTEM.contains(OPERATING_SYSTEM_OSX));
1✔
1236
        
1237
        public static final boolean WINDOWS_BASED_OPERATING_SYSTEM = OPERATING_SYSTEM.contains("Windows");
1✔
1238
        
1239
        public static final boolean WINDOWS_VISTA_OPERATING_SYSTEM = OPERATING_SYSTEM.equals(OPERATING_SYSTEM_WINDOWS_VISTA);
1✔
1240
        
1241
        /**
1242
         * Marker put into the serialization session map to tell @Replace methods whether or not to do
1243
         * just the very basic serialization
1244
         */
1245
        public static final String SHORT_SERIALIZATION = "isShortSerialization";
1246
        
1247
        // Global property key for global logger level
1248
        public static final String GLOBAL_PROPERTY_LOG_LEVEL = "log.level";
1249
        
1250
        /**
1251
         * It points to a directory where 'openmrs.log' is stored.
1252
         *
1253
         * @since 1.9.2
1254
         */
1255
        public static final String GP_LOG_LOCATION = "log.location";
1256
        
1257
        /**
1258
         * It specifies a log layout pattern used by the OpenMRS file appender.
1259
         *
1260
         * @since 1.9.2
1261
         */
1262
        public static final String GP_LOG_LAYOUT = "log.layout";
1263
        
1264
        /**
1265
         * It specifies a default name of the OpenMRS file appender.
1266
         * .
1267
         * @since 1.9.2
1268
         */
1269
        public static final String LOG_OPENMRS_FILE_APPENDER = "OPENMRS FILE APPENDER";
1270
        
1271
        // Global logger category
1272
        public static final String LOG_CLASS_DEFAULT = "org.openmrs.api";
1273
        
1274
        // Log levels
1275
        public static final String LOG_LEVEL_TRACE = "trace";
1276
        
1277
        public static final String LOG_LEVEL_DEBUG = "debug";
1278
        
1279
        public static final String LOG_LEVEL_INFO = "info";
1280
        
1281
        public static final String LOG_LEVEL_WARN = "warn";
1282
        
1283
        public static final String LOG_LEVEL_ERROR = "error";
1284
        
1285
        public static final String LOG_LEVEL_FATAL = "fatal";
1286
        
1287
        /**
1288
         * The name of the in-memory appender
1289
         */
1290
        public static final String MEMORY_APPENDER_NAME = "MEMORY_APPENDER";
1291

1292
        /**
1293
         * Default url responsible for authentication if a user is not logged in.
1294
         *
1295
         * @see  #GP_LOGIN_URL
1296
         */
1297
        public static final String LOGIN_URL = "login.htm";
1298
        
1299
        /**
1300
         * Global property name that defines the default url
1301
         * responsible for authentication if user is not logged in.
1302
         *
1303
         *  @see #LOGIN_URL
1304
         */
1305
        public static final String GP_LOGIN_URL = "login.url";
1306
        
1307
        /**
1308
         * These enumerations should be used in ObsService and PersonService getters to help determine
1309
         * which type of object to restrict on
1310
         *
1311
         * @see org.openmrs.api.ObsService
1312
         * @see org.openmrs.api.PersonService
1313
         */
1314
        public static enum PERSON_TYPE {
1✔
1315
                PERSON,
1✔
1316
                PATIENT,
1✔
1317
                USER
1✔
1318
        }
1319
        
1320
        //Patient Identifier Validators
1321
        public static final String LUHN_IDENTIFIER_VALIDATOR = LuhnIdentifierValidator.class.getName();
1✔
1322
        
1323
        /** The data type to return on failing to load a custom data type. */
1324
        public static final String DEFAULT_CUSTOM_DATATYPE = FreeTextDatatype.class.getName();
1✔
1325
        
1326
        /**Prefix followed by registered component name.*/
1327
        public static final String REGISTERED_COMPONENT_NAME_PREFIX = "bean:";
1328
        
1329
        /** Value for the short person name format */
1330
        public static final String PERSON_NAME_FORMAT_SHORT = "short";
1331
        
1332
        /** Value for the long person name format */
1333
        public static final String PERSON_NAME_FORMAT_LONG = "long";
1334

1335
        // Liquibase Constants
1336
        public static final String LIQUIBASE_DUPLICATE_FILE_MODE_DEFAULT = GlobalConfiguration.DuplicateFileMode.SILENT.name();
1✔
1337

1338
        /** Value for zero login attempts */
1339
        public static final String ZERO_LOGIN_ATTEMPTS_VALUE = "0";
1340
        
1341
        private OpenmrsConstants() {
1342
        }
1343
        
1344
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc