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

openmrs / openmrs-core / 18842842547

27 Oct 2025 01:35PM UTC coverage: 64.894% (+0.008%) from 64.886%
18842842547

push

github

web-flow
TRUNK-6448: Orders: Allow setting Order Number and Stopping Inactive Orders Based On Global Property (#5418)

17 of 23 new or added lines in 4 files covered. (73.91%)

1 existing line in 1 file now uncovered.

23435 of 36113 relevant lines covered (64.89%)

0.65 hits per line

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

16.87
/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 java.io.IOException;
13
import java.io.InputStream;
14
import java.util.Collection;
15
import java.util.Collections;
16
import java.util.LinkedHashMap;
17
import java.util.List;
18
import java.util.ArrayList;
19
import java.util.Locale;
20
import java.util.Map;
21
import java.util.Properties;
22

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

37
import static java.util.Arrays.asList;
38

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

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

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

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

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

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

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

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

736
                props.add(new GlobalProperty(GP_PASSWORD_RESET_URL, "",
×
737
                        "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."));
738
                
739
                props.add(new GlobalProperty("mail.transport_protocol", "smtp",
×
740
                        "Transport protocol for the messaging engine. Valid values: smtp"));
741
                props.add(new GlobalProperty("mail.smtp_host", "localhost", "SMTP host name"));
×
742
                props.add(new GlobalProperty("mail.smtp_port", "25", "SMTP port"));
×
743
                props.add(new GlobalProperty("mail.from", "info@openmrs.org", "Email address to use as the default from address"));
×
744
                props.add(new GlobalProperty("mail.debug", "false",
×
745
                        "true/false whether to print debugging information during mailing"));
746
                props.add(new GlobalProperty("mail.smtp_auth", "false", "true/false whether the smtp host requires authentication"));
×
747
                props.add(new GlobalProperty("mail.user", "test", "Username of the SMTP user (if smtp_auth is enabled)"));
×
748
                props.add(new GlobalProperty("mail.password", "test", "Password for the SMTP user (if smtp_auth is enabled)"));
×
749
                props.add(new GlobalProperty("mail.default_content_type", "text/plain",
×
750
                        "Content type to append to the mail messages"));
751
                
752
                props.add(new GlobalProperty(ModuleConstants.REPOSITORY_FOLDER_PROPERTY,
×
753
                        ModuleConstants.REPOSITORY_FOLDER_PROPERTY_DEFAULT, "Name of the folder in which to store the modules"));
754
                props.add(new GlobalProperty(GLOBAL_PROPERTY_ADDRESS_TEMPLATE, DEFAULT_ADDRESS_TEMPLATE,
×
755
                        "XML description of address formats"));
756
                props.add(new GlobalProperty(GLOBAL_PROPERTY_LAYOUT_NAME_FORMAT, PERSON_NAME_FORMAT_SHORT,
×
757
                        "Format in which to display the person names.  Valid values are short, long"));
758
                
759
                // TODO should be changed to text defaults and constants should be removed
760
                props.add(new GlobalProperty("scheduler.username", SchedulerConstants.SCHEDULER_DEFAULT_USERNAME,
×
761
                        "Username for the OpenMRS user that will perform the scheduler activities"));
762
                props.add(new GlobalProperty("scheduler.password", SchedulerConstants.SCHEDULER_DEFAULT_PASSWORD,
×
763
                        "Password for the OpenMRS user that will perform the scheduler activities"));
764
                
765
                props.add(new GlobalProperty(GLOBAL_PROPERTY_CONCEPTS_LOCKED, "false", "if true, do not allow editing concepts",
×
766
                        BooleanDatatype.class, null));
767
                
768
                props.add(new GlobalProperty(GLOBAL_PROPERTY_PATIENT_LISTING_ATTRIBUTES, "",
×
769
                        "A comma delimited list of PersonAttributeType names that should be displayed for patients in _lists_"));
770
                props
×
771
                        .add(new GlobalProperty(GLOBAL_PROPERTY_PATIENT_VIEWING_ATTRIBUTES, "",
×
772
                                "A comma delimited list of PersonAttributeType names that should be displayed for patients when _viewing individually_"));
773
                props.add(new GlobalProperty(GLOBAL_PROPERTY_PATIENT_HEADER_ATTRIBUTES, "",
×
774
                        "A comma delimited list of PersonAttributeType names that will be shown on the patient dashboard"));
775
                
776
                props.add(new GlobalProperty(GLOBAL_PROPERTY_USER_LISTING_ATTRIBUTES, "",
×
777
                        "A comma delimited list of PersonAttributeType names that should be displayed for users in _lists_"));
778
                props
×
779
                        .add(new GlobalProperty(GLOBAL_PROPERTY_USER_VIEWING_ATTRIBUTES, "",
×
780
                                "A comma delimited list of PersonAttributeType names that should be displayed for users when _viewing individually_"));
781
                props
×
782
                        .add(new GlobalProperty(GLOBAL_PROPERTY_USER_HEADER_ATTRIBUTES, "",
×
783
                                "A comma delimited list of PersonAttributeType names that will be shown on the user dashboard. (not used in v1.5)"));
784
                
785
                props
×
786
                        .add(new GlobalProperty(
×
787
                                GLOBAL_PROPERTY_PATIENT_IDENTIFIER_REGEX,
788
                                "",
789
                                "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])?$"));
790
                props
×
791
                        .add(new GlobalProperty(
×
792
                                GLOBAL_PROPERTY_PATIENT_IDENTIFIER_PREFIX,
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_SUFFIX,
800
                                "",
801
                                "This property is only used if "
802
                                        + GLOBAL_PROPERTY_PATIENT_IDENTIFIER_REGEX
803
                                        + " 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."));
804
                props
×
805
                        .add(new GlobalProperty(
×
806
                                GLOBAL_PROPERTY_PATIENT_IDENTIFIER_SEARCH_PATTERN,
807
                                "",
808
                                "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')\""));
809
                
810
                props
×
811
                        .add(new GlobalProperty(
×
812
                                GLOBAL_PROPERTY_PATIENT_NAME_REGEX,
813
                                "",
814
                                "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."));
815
                
816
                props.add(new GlobalProperty(GLOBAL_PROPERTY_PERSON_SEARCH_MAX_RESULTS, String
×
817
                        .valueOf(GLOBAL_PROPERTY_PERSON_SEARCH_MAX_RESULTS_DEFAULT_VALUE),
×
818
                        "The maximum number of results returned by patient searches"));
819
                
820
                props
×
821
                        .add(new GlobalProperty(
×
822
                                GLOBAL_PROPERTY_GZIP_ENABLED,
823
                                "false",
824
                                "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.",
825
                                BooleanDatatype.class, null));
826
                
827
        
828
                props
×
829
                        .add(new GlobalProperty(
×
830
                                GLOBAL_PROPERTY_LOG_LEVEL,
831
                                "org.openmrs.api:" + LOG_LEVEL_INFO,
832
                                "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"));
833
                
834
                props.add(new GlobalProperty(GP_LOG_LOCATION, "",
×
835
                        "A directory where the OpenMRS log file appender is stored. The log file name is 'openmrs.log'."));
836
                
837
                props.add(new GlobalProperty(GP_LOG_LAYOUT, "%p - %C{1}.%M(%L) |%d{ISO8601}| %m%n",
×
838
                        "A log layout pattern which is used by the OpenMRS file appender."));
839
                
840
                props
×
841
                        .add(new GlobalProperty(
×
842
                                GLOBAL_PROPERTY_DEFAULT_PATIENT_IDENTIFIER_VALIDATOR,
843
                                LUHN_IDENTIFIER_VALIDATOR,
844
                                "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."));
845
                
846
                props
×
847
                        .add(new GlobalProperty(
×
848
                                GLOBAL_PROPERTY_PATIENT_IDENTIFIER_IMPORTANT_TYPES,
849
                                "",
850
                                "A comma delimited list of PatientIdentifier names : PatientIdentifier locations that will be displayed on the patient dashboard.  E.g.: TRACnet ID:Rwanda,ELDID:Kenya"));
851
                
852
                props.add(new GlobalProperty(GLOBAL_PROPERTY_COMPLEX_OBS_DIR, "complex_obs",
×
853
                        "Default directory for storing complex obs."));
854
                
855
                props
×
856
                        .add(new GlobalProperty(
×
857
                                GLOBAL_PROPERTY_ENCOUNTER_FORM_OBS_SORT_ORDER,
858
                                "number",
859
                                "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."));
860
                
861
                props.add(new GlobalProperty(GLOBAL_PROPERTY_LOCALE_ALLOWED_LIST, "en, en_GB, es, fr, it, pt",
×
862
                        "Comma delimited list of locales allowed for use on system"));
863
                
864
                props
×
865
                        .add(new GlobalProperty(
×
866
                                GLOBAL_PROPERTY_NEWPATIENTFORM_RELATIONSHIPS,
867
                                "",
868
                                "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."));
869
                
870
                props.add(new GlobalProperty(GLOBAL_PROPERTY_MIN_SEARCH_CHARACTERS, "2",
×
871
                        "Number of characters user must input before searching is started."));
872
                
873
                props
×
874
                        .add(new GlobalProperty(
×
875
                                OpenmrsConstants.GLOBAL_PROPERTY_DEFAULT_LOCALE,
876
                                OpenmrsConstants.GLOBAL_PROPERTY_DEFAULT_LOCALE_DEFAULT_VALUE,
877
                                "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'"));
878
                
879
                props.add(new GlobalProperty(OpenmrsConstants.GLOBAL_PROPERTY_DEFAULT_WEEK_START_DAY,
×
880
                        OpenmrsConstants.GLOBAL_PROPERTY_DEFAULT_WEEK_START_DAY_DEFAULT_VALUE,
881
                        "First day of the week in the date picker. Domingo/Dimanche/Sunday:0  Lunes/Lundi/Monday:1"));
882
                
883
                props.add(new GlobalProperty(GP_PASSWORD_CANNOT_MATCH_USERNAME_OR_SYSTEMID, "true",
×
884
                        "Configure whether passwords must not match user's username or system id", BooleanDatatype.class, null));
885
                
886
                props.add(new GlobalProperty(GP_PASSWORD_CUSTOM_REGEX, "",
×
887
                        "Configure a custom regular expression that a password must match"));
888
                
889
                props.add(new GlobalProperty(GP_PASSWORD_MINIMUM_LENGTH, "8",
×
890
                        "Configure the minimum length required of all passwords"));
891
                
892
                props.add(new GlobalProperty(GP_PASSWORD_RESET_VALIDTIME, "600000",
×
893
                        " 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"));
894
                
895
                props.add(new GlobalProperty(GP_PASSWORD_REQUIRES_DIGIT, "true",
×
896
                        "Configure whether passwords must contain at least one digit", BooleanDatatype.class, null));
897
                
898
                props.add(new GlobalProperty(GP_PASSWORD_REQUIRES_NON_DIGIT, "true",
×
899
                        "Configure whether passwords must contain at least one non-digit", BooleanDatatype.class, null));
900
                
901
                props
×
902
                        .add(new GlobalProperty(GP_PASSWORD_REQUIRES_UPPER_AND_LOWER_CASE, "true",
×
903
                                "Configure whether passwords must contain both upper and lower case characters",
904
                                BooleanDatatype.class, null));
905
                
906
                props.add(new GlobalProperty(GLOBAL_PROPERTY_IGNORE_MISSING_NONLOCAL_PATIENTS, "false",
×
907
                        "If true, hl7 messages for patients that are not found and are non-local will silently be dropped/ignored",
908
                        BooleanDatatype.class, null));
909
                
910
                props
×
911
                        .add(new GlobalProperty(
×
912
                                GLOBAL_PROPERTY_SHOW_PATIENT_NAME,
913
                                "false",
914
                                "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.",
915
                                BooleanDatatype.class, null));
916
                
917
                props.add(new GlobalProperty(GLOBAL_PROPERTY_DEFAULT_THEME, "",
×
918
                        "Default theme for users.  OpenMRS ships with themes of 'green', 'orange', 'purple', and 'legacy'"));
919
                
920
                props.add(new GlobalProperty(GLOBAL_PROPERTY_HL7_ARCHIVE_DIRECTORY, HL7Constants.HL7_ARCHIVE_DIRECTORY_NAME,
×
921
                        "The default name or absolute path for the folder where to write the hl7_in_archives."));
922
                
923
                props.add(new GlobalProperty(GLOBAL_PROPERTY_REPORT_BUG_URL, "http://errors.openmrs.org/scrap",
×
924
                        "The openmrs url where to submit bug reports"));
925
                
926
                props.add(new GlobalProperty(GP_SEARCH_WIDGET_BATCH_SIZE, "200",
×
927
                        "The maximum number of search results that are returned by an ajax call"));
928
                
929
                props
×
930
                        .add(new GlobalProperty(
×
931
                                GP_SEARCH_WIDGET_IN_SERIAL_MODE,
932
                                "false",
933
                                "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",
934
                                BooleanDatatype.class, null));
935
                
936
                props
×
937
                        .add(new GlobalProperty(
×
938
                                GP_SEARCH_WIDGET_DELAY_INTERVAL,
939
                                "300",
940
                                "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"));
941
                
942
                props
×
943
                        .add(new GlobalProperty(GP_SEARCH_DATE_DISPLAY_FORMAT, null,
×
944
                                "Date display format to be used to display the date somewhere in the UI i.e the search widgets and autocompletes"));
945
                
946
                props.add(new GlobalProperty(GLOBAL_PROPERTY_DEFAULT_LOCATION_NAME, "Unknown Location",
×
947
                        "The name of the location to use as a system default"));
948
                props
×
949
                                .add(new GlobalProperty(
×
950
                                                GLOBAL_PROPERTY_PATIENT_IDENTIFIER_SEARCH_MATCH_MODE,
951
                                                GLOBAL_PROPERTY_PATIENT_SEARCH_MATCH_EXACT,
952
                                                "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."));
953
                
954
                props
×
955
                        .add(new GlobalProperty(
×
956
                                GLOBAL_PROPERTY_PATIENT_SEARCH_MATCH_MODE,
957
                                GLOBAL_PROPERTY_PATIENT_SEARCH_MATCH_START,
958
                                "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."));
959
                
960
                props.add(new GlobalProperty(GP_ENABLE_CONCEPT_MAP_TYPE_MANAGEMENT, "false",
×
961
                        "Enables or disables management of concept map types", BooleanDatatype.class, null));
962
                
963
                props
×
964
                        .add(new GlobalProperty(
×
965
                                GLOBAL_PROPERTY_ENABLE_VISITS,
966
                                "true",
967
                                "Set to true to enable the Visits feature. This will replace the 'Encounters' tab with a 'Visits' tab on the dashboard.",
968
                                BooleanDatatype.class, null));
969
                
970
                props.add(new GlobalProperty(GP_VISIT_ASSIGNMENT_HANDLER, ExistingVisitAssignmentHandler.class.getName(),
×
971
                        "Set to the name of the class responsible for assigning encounters to visits."));
972
                
973
                props.add(new GlobalProperty(GLOBAL_PROPERTY_APPLICATION_NAME, "OpenMRS",
×
974
                        "The name of this application, as presented to the user, for example on the login and welcome pages."));
975
                
976
                props
×
977
                        .add(new GlobalProperty(
×
978
                                GP_ENCOUNTER_TYPE_TO_VISIT_TYPE_MAPPING,
979
                                "",
980
                                "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"));
981
                
982
                props.add(new GlobalProperty(GLOBAL_PROPERTY_ENCOUNTER_TYPES_LOCKED, "false",
×
983
                        "saving, retiring or deleting an Encounter Type is not permitted, if true", BooleanDatatype.class, null));
984
                
985
                props
×
986
                        .add(new GlobalProperty(
×
987
                                GP_DASHBOARD_PROVIDER_DISPLAY_ENCOUNTER_ROLES,
988
                                "",
989
                                "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."));
990
                
991
                props.add(new GlobalProperty(GP_SEARCH_WIDGET_MAXIMUM_RESULTS, "2000",
×
992
                        "Specifies the maximum number of results to return from a single search in the search widgets"));
993
                
994
                props
×
995
                        .add(new GlobalProperty(
×
996
                                GP_DASHBOARD_MAX_NUMBER_OF_ENCOUNTERS_TO_SHOW,
997
                                "3",
998
                                "An integer which, if specified, would determine the maximum number of encounters to display on the encounter tab of the patient dashboard."));
999
                
1000
                props.add(new GlobalProperty(GP_VISIT_TYPES_TO_AUTO_CLOSE, "",
×
1001
                        "comma-separated list of the visit type(s) to automatically close"));
1002
                
1003
                props.add(new GlobalProperty(GP_ALLOWED_FAILED_LOGINS_BEFORE_LOCKOUT, "7",
×
1004
                        "Maximum number of failed logins allowed after which username is locked out"));
1005

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

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

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

NEW
1066
                props.add(new GlobalProperty(GP_ALLOW_SETTING_ORDER_NUMBER, "false",
×
1067
                        "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."));
1068
                
NEW
1069
                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."));
×
1070
                
1071
                props.add(new GlobalProperty(GP_DRUG_ROUTES_CONCEPT_UUID, "",
×
1072
                        "Specifies the uuid of the concept set where its members represent the possible drug routes"));
1073
                
1074
                props.add(new GlobalProperty(GP_DRUG_DOSING_UNITS_CONCEPT_UUID, "",
×
1075
                        "Specifies the uuid of the concept set where its members represent the possible drug dosing units"));
1076
                
1077
                props.add(new GlobalProperty(GP_DRUG_DISPENSING_UNITS_CONCEPT_UUID, "",
×
1078
                        "Specifies the uuid of the concept set where its members represent the possible drug dispensing units"));
1079
                
1080
                props.add(new GlobalProperty(GP_DURATION_UNITS_CONCEPT_UUID, "",
×
1081
                        "Specifies the uuid of the concept set where its members represent the possible duration units"));
1082
                
1083
                props.add(new GlobalProperty(GP_TEST_SPECIMEN_SOURCES_CONCEPT_UUID, "",
×
1084
                        "Specifies the uuid of the concept set where its members represent the possible test specimen sources"));
1085
                
1086
                props.add(new GlobalProperty(GP_UNKNOWN_PROVIDER_UUID, "", "Specifies the uuid of the Unknown Provider account"));
×
1087
                
1088
                props
×
1089
                        .add(new GlobalProperty(
×
1090
                                GLOBAL_PROPERTY_PROVIDER_SEARCH_MATCH_MODE,
1091
                                "EXACT",
1092
                                "Specifies how provider identifiers are matched while searching for providers. Valid values are START,EXACT, END or ANYWHERE"));
1093
                
1094
                props
×
1095
                        .add(new GlobalProperty(
×
1096
                                GLOBAL_PROPERTY_PERSON_ATTRIBUTE_SEARCH_MATCH_MODE,
1097
                                GLOBAL_PROPERTY_PERSON_ATTRIBUTE_SEARCH_MATCH_EXACT,
1098
                                "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."));
1099

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

1103

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

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

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

1342
        // Liquibase Constants
1343
        public static final String LIQUIBASE_DUPLICATE_FILE_MODE_DEFAULT = GlobalConfiguration.DuplicateFileMode.SILENT.name();
1✔
1344

1345
        /** Value for zero login attempts */
1346
        public static final String ZERO_LOGIN_ATTEMPTS_VALUE = "0";
1347
        
1348
        private OpenmrsConstants() {
1349
        }
1350
        
1351
}
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