Search in sources :

Example 36 with GlobalProperty

use of org.openmrs.GlobalProperty in project openmrs-core by openmrs.

the class EncounterServiceTest method saveEncounter_shouldAssignEncounterToVisitIfTheAssignToExistingOrNewHandlerIsRegistered.

/**
 * @see EncounterService#saveEncounter(Encounter)
 */
@Test
public void saveEncounter_shouldAssignEncounterToVisitIfTheAssignToExistingOrNewHandlerIsRegistered() {
    Encounter encounter = new Encounter();
    encounter.setLocation(new Location(2));
    encounter.setEncounterType(new EncounterType(1));
    encounter.setEncounterDatetime(new Date());
    encounter.setPatient(new Patient(2));
    encounter.setCreator(new User(4));
    // We should have no visit
    assertNull(encounter.getVisit());
    GlobalProperty gp = Context.getAdministrationService().getGlobalPropertyObject(OpenmrsConstants.GP_VISIT_ASSIGNMENT_HANDLER);
    gp.setPropertyValue("org.openmrs.api.handler.ExistingOrNewVisitAssignmentHandler");
    Context.getAdministrationService().saveGlobalProperty(gp);
    Calendar calendar = Calendar.getInstance();
    calendar.setTime(encounter.getEncounterDatetime());
    calendar.set(Calendar.YEAR, 1900);
    encounter.setEncounterDatetime(calendar.getTime());
    Context.getEncounterService().saveEncounter(encounter);
    // We should have a visit.
    assertNotNull(encounter.getVisit());
    // The visit should be persisted.
    assertNotNull(encounter.getVisit().getVisitId());
}
Also used : User(org.openmrs.User) Calendar(java.util.Calendar) Encounter(org.openmrs.Encounter) Patient(org.openmrs.Patient) EncounterType(org.openmrs.EncounterType) Date(java.util.Date) Location(org.openmrs.Location) GlobalProperty(org.openmrs.GlobalProperty) BaseContextSensitiveTest(org.openmrs.test.BaseContextSensitiveTest) Test(org.junit.Test)

Example 37 with GlobalProperty

use of org.openmrs.GlobalProperty in project openmrs-core by openmrs.

the class ConceptServiceTest method getDefaultConceptMapType_shouldReturnTypeAsSetInGp.

/**
 * @see ConceptService#getDefaultConceptMapType()
 */
@Test
public void getDefaultConceptMapType_shouldReturnTypeAsSetInGp() {
    final String testName = "is a";
    Context.getAdministrationService().saveGlobalProperty(new GlobalProperty("concept.defaultConceptMapType", testName));
    ConceptMapType conceptMapType = conceptService.getDefaultConceptMapType();
    Assert.assertNotNull(conceptMapType);
    Assert.assertEquals(testName, conceptMapType.getName());
}
Also used : ConceptMapType(org.openmrs.ConceptMapType) GlobalProperty(org.openmrs.GlobalProperty) BaseContextSensitiveTest(org.openmrs.test.BaseContextSensitiveTest) Test(org.junit.Test)

Example 38 with GlobalProperty

use of org.openmrs.GlobalProperty in project openmrs-core by openmrs.

the class ConceptServiceTest method createTrueFalseGlobalProperties.

/**
 * Utility method that creates the global properties 'concept.true' and 'concept.false'
 */
private static void createTrueFalseGlobalProperties() {
    GlobalProperty trueConceptGlobalProperty = new GlobalProperty(OpenmrsConstants.GLOBAL_PROPERTY_TRUE_CONCEPT, "7", "Concept id of the concept defining the TRUE boolean concept");
    GlobalProperty falseConceptGlobalProperty = new GlobalProperty(OpenmrsConstants.GLOBAL_PROPERTY_FALSE_CONCEPT, "8", "Concept id of the concept defining the TRUE boolean concept");
    Context.getAdministrationService().saveGlobalProperty(trueConceptGlobalProperty);
    Context.getAdministrationService().saveGlobalProperty(falseConceptGlobalProperty);
}
Also used : GlobalProperty(org.openmrs.GlobalProperty)

Example 39 with GlobalProperty

use of org.openmrs.GlobalProperty in project openmrs-core by openmrs.

the class EncounterServiceTest method getActiveEncounterVisitHandler_shouldThrowIfBeanWithGivenTypeAndNameNotFound.

@Test(expected = APIException.class)
public void getActiveEncounterVisitHandler_shouldThrowIfBeanWithGivenTypeAndNameNotFound() {
    String incorrectBeanName = OpenmrsConstants.REGISTERED_COMPONENT_NAME_PREFIX + "invalidName";
    GlobalProperty visitHandlerProperty = new GlobalProperty(OpenmrsConstants.GP_VISIT_ASSIGNMENT_HANDLER, incorrectBeanName);
    Context.getAdministrationService().saveGlobalProperty(visitHandlerProperty);
    Context.getEncounterService().getActiveEncounterVisitHandler();
}
Also used : GlobalProperty(org.openmrs.GlobalProperty) BaseContextSensitiveTest(org.openmrs.test.BaseContextSensitiveTest) Test(org.junit.Test)

Example 40 with GlobalProperty

use of org.openmrs.GlobalProperty in project openmrs-core by openmrs.

the class OpenmrsConstants method CORE_GLOBAL_PROPERTIES.

/**
 * At OpenMRS startup these global properties/default values/descriptions are inserted into the
 * database if they do not exist yet.
 *
 * @return List<GlobalProperty> of the core global properties
 */
public static final List<GlobalProperty> CORE_GLOBAL_PROPERTIES() {
    List<GlobalProperty> props = new ArrayList<>();
    props.add(new GlobalProperty("use_patient_attribute.healthCenter", "false", "Indicates whether or not the 'health center' attribute is shown when viewing/searching for patients", BooleanDatatype.class, null));
    props.add(new GlobalProperty("use_patient_attribute.mothersName", "false", "Indicates whether or not mother's name is able to be added/viewed for a patient", BooleanDatatype.class, null));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_NEWPATIENTFORM_SHOW_RELATIONSHIPS, "false", "true/false whether or not to show the relationship editor on the addPatient.htm screen", BooleanDatatype.class, null));
    props.add(new GlobalProperty("dashboard.overview.showConcepts", "", "Comma delimited list of concepts ids to show on the patient dashboard overview tab"));
    props.add(new GlobalProperty(GP_DASHBOARD_CONCEPTS, "5497", "Comma delimited list of concepts ids to show on the patient header overview"));
    props.add(new GlobalProperty("dashboard.encounters.showEmptyFields", "true", "true/false whether or not to show empty fields on the 'View Encounter' window", BooleanDatatype.class, null));
    props.add(new GlobalProperty("dashboard.encounters.usePages", "smart", "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"));
    props.add(new GlobalProperty("dashboard.encounters.showViewLink", "true", "true/false whether or not to show the 'View Encounter' link on the patient dashboard", BooleanDatatype.class, null));
    props.add(new GlobalProperty("dashboard.encounters.showEditLink", "true", "true/false whether or not to show the 'Edit Encounter' link on the patient dashboard", BooleanDatatype.class, null));
    props.add(new GlobalProperty("dashboard.header.programs_to_show", "", "List of programs to show Enrollment details of in the patient header. (Should be an ordered comma-separated list of program_ids or names.)"));
    props.add(new GlobalProperty("dashboard.header.workflows_to_show", "", "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.)"));
    props.add(new GlobalProperty("dashboard.relationships.show_types", "", "Types of relationships separated by commas.  Doctor/Patient,Parent/Child"));
    props.add(new GlobalProperty("FormEntry.enableDashboardTab", "true", "true/false whether or not to show a Form Entry tab on the patient dashboard", BooleanDatatype.class, null));
    props.add(new GlobalProperty("FormEntry.enableOnEncounterTab", "false", "true/false whether or not to show a Enter Form button on the encounters tab of the patient dashboard", BooleanDatatype.class, null));
    props.add(new GlobalProperty("dashboard.regimen.displayDrugSetIds", "ANTIRETROVIRAL DRUGS,TUBERCULOSIS TREATMENT DRUGS", "Drug sets that appear on the Patient Dashboard Regimen tab. Comma separated list of name of concepts that are defined as drug sets."));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_DRUG_FREQUENCIES, "7 days/week,6 days/week,5 days/week,4 days/week,3 days/week,2 days/week,1 days/week", "Frequency of a drug order that appear on the Patient Dashboard. Comma separated list of name of concepts that are defined as drug frequencies."));
    props.add(new GlobalProperty(GP_GRAPH_COLOR_ABSOLUTE, "rgb(20,20,20)", "Color of the 'invalid' section of numeric graphs on the patient dashboard."));
    props.add(new GlobalProperty(GP_GRAPH_COLOR_NORMAL, "rgb(255,126,0)", "Color of the 'normal' section of numeric graphs on the patient dashboard."));
    props.add(new GlobalProperty(GP_GRAPH_COLOR_CRITICAL, "rgb(200,0,0)", "Color of the 'critical' section of numeric graphs on the patient dashboard."));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_LOCATION_WIDGET_TYPE, "default", "Type of widget to use for location fields"));
    props.add(new GlobalProperty(GP_MAIL_SMTP_STARTTLS_ENABLE, "false", "Set to true to enable TLS encryption, else set to false"));
    props.add(new GlobalProperty("concept.weight", "5089", "Concept id of the concept defining the WEIGHT concept"));
    props.add(new GlobalProperty("concept.height", "5090", "Concept id of the concept defining the HEIGHT concept"));
    props.add(new GlobalProperty("concept.none", "1107", "Concept id of the concept defining the NONE concept"));
    props.add(new GlobalProperty("concept.otherNonCoded", "5622", "Concept id of the concept defining the OTHER NON-CODED concept"));
    props.add(new GlobalProperty("mail.transport_protocol", "smtp", "Transport protocol for the messaging engine. Valid values: smtp"));
    props.add(new GlobalProperty("mail.smtp_host", "localhost", "SMTP host name"));
    props.add(new GlobalProperty("mail.smtp_port", "25", "SMTP port"));
    props.add(new GlobalProperty("mail.from", "info@openmrs.org", "Email address to use as the default from address"));
    props.add(new GlobalProperty("mail.debug", "false", "true/false whether to print debugging information during mailing"));
    props.add(new GlobalProperty("mail.smtp_auth", "false", "true/false whether the smtp host requires authentication"));
    props.add(new GlobalProperty("mail.user", "test", "Username of the SMTP user (if smtp_auth is enabled)"));
    props.add(new GlobalProperty("mail.password", "test", "Password for the SMTP user (if smtp_auth is enabled)"));
    props.add(new GlobalProperty("mail.default_content_type", "text/plain", "Content type to append to the mail messages"));
    props.add(new GlobalProperty(ModuleConstants.REPOSITORY_FOLDER_PROPERTY, ModuleConstants.REPOSITORY_FOLDER_PROPERTY_DEFAULT, "Name of the folder in which to store the modules"));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_ADDRESS_TEMPLATE, DEFAULT_ADDRESS_TEMPLATE, "XML description of address formats"));
    props.add(new GlobalProperty("layout.name.format", "short", "Format in which to display the person names.  Valid values are short, long"));
    // TODO should be changed to text defaults and constants should be removed
    props.add(new GlobalProperty("scheduler.username", SchedulerConstants.SCHEDULER_DEFAULT_USERNAME, "Username for the OpenMRS user that will perform the scheduler activities"));
    props.add(new GlobalProperty("scheduler.password", SchedulerConstants.SCHEDULER_DEFAULT_PASSWORD, "Password for the OpenMRS user that will perform the scheduler activities"));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_CONCEPTS_LOCKED, "false", "if true, do not allow editing concepts", BooleanDatatype.class, null));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_PATIENT_LISTING_ATTRIBUTES, "", "A comma delimited list of PersonAttributeType names that should be displayed for patients in _lists_"));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_PATIENT_VIEWING_ATTRIBUTES, "", "A comma delimited list of PersonAttributeType names that should be displayed for patients when _viewing individually_"));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_PATIENT_HEADER_ATTRIBUTES, "", "A comma delimited list of PersonAttributeType names that will be shown on the patient dashboard"));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_USER_LISTING_ATTRIBUTES, "", "A comma delimited list of PersonAttributeType names that should be displayed for users in _lists_"));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_USER_VIEWING_ATTRIBUTES, "", "A comma delimited list of PersonAttributeType names that should be displayed for users when _viewing individually_"));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_USER_HEADER_ATTRIBUTES, "", "A comma delimited list of PersonAttributeType names that will be shown on the user dashboard. (not used in v1.5)"));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_PATIENT_IDENTIFIER_REGEX, "", "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])?$"));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_PATIENT_IDENTIFIER_PREFIX, "", "This property is only used if " + GLOBAL_PROPERTY_PATIENT_IDENTIFIER_REGEX + " 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."));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_PATIENT_IDENTIFIER_SUFFIX, "", "This property is only used if " + GLOBAL_PROPERTY_PATIENT_IDENTIFIER_REGEX + " 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."));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_PATIENT_IDENTIFIER_SEARCH_PATTERN, "", "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')\""));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_PATIENT_NAME_REGEX, "", "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."));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_PERSON_SEARCH_MAX_RESULTS, String.valueOf(GLOBAL_PROPERTY_PERSON_SEARCH_MAX_RESULTS_DEFAULT_VALUE), "The maximum number of results returned by patient searches"));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_GZIP_ENABLED, "false", "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.", BooleanDatatype.class, null));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_MEDICAL_RECORD_OBSERVATIONS, "1238", "The concept id of the MEDICAL_RECORD_OBSERVATIONS concept.  This concept_id is presumed to be the generic grouping (obr) concept in hl7 messages.  An obs_group row is not created for this concept."));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_PROBLEM_LIST, "1284", "The concept id of the PROBLEM LIST concept.  This concept_id is presumed to be the generic grouping (obr) concept in hl7 messages.  An obs_group row is not created for this concept."));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_LOG_LEVEL, "org.openmrs.api:" + LOG_LEVEL_INFO, "Logging levels for log4j.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"));
    props.add(new GlobalProperty(GP_LOG_LOCATION, "", "A directory where the OpenMRS log file appender is stored. The log file name is 'openmrs.log'."));
    props.add(new GlobalProperty(GP_LOG_LAYOUT, "%p - %C{1}.%M(%L) |%d{ISO8601}| %m%n", "A log layout pattern which is used by the OpenMRS file appender."));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_DEFAULT_PATIENT_IDENTIFIER_VALIDATOR, LUHN_IDENTIFIER_VALIDATOR, "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."));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_PATIENT_IDENTIFIER_IMPORTANT_TYPES, "", "A comma delimited list of PatientIdentifier names : PatientIdentifier locations that will be displayed on the patient dashboard.  E.g.: TRACnet ID:Rwanda,ELDID:Kenya"));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_COMPLEX_OBS_DIR, "complex_obs", "Default directory for storing complex obs."));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_ENCOUNTER_FORM_OBS_SORT_ORDER, "number", "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."));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_LOCALE_ALLOWED_LIST, "en, en_GB, es, fr, it, pt", "Comma delimited list of locales allowed for use on system"));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_NEWPATIENTFORM_RELATIONSHIPS, "", "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."));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_MIN_SEARCH_CHARACTERS, "2", "Number of characters user must input before searching is started."));
    props.add(new GlobalProperty(OpenmrsConstants.GLOBAL_PROPERTY_DEFAULT_LOCALE, OpenmrsConstants.GLOBAL_PROPERTY_DEFAULT_LOCALE_DEFAULT_VALUE, "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'"));
    props.add(new GlobalProperty(OpenmrsConstants.GLOBAL_PROPERTY_DEFAULT_WEEK_START_DAY, OpenmrsConstants.GLOBAL_PROPERTY_DEFAULT_WEEK_START_DAY_DEFAULT_VALUE, "First day of the week in the date picker. Domingo/Dimanche/Sunday:0  Lunes/Lundi/Monday:1"));
    props.add(new GlobalProperty(GP_PASSWORD_CANNOT_MATCH_USERNAME_OR_SYSTEMID, "true", "Configure whether passwords must not match user's username or system id", BooleanDatatype.class, null));
    props.add(new GlobalProperty(GP_PASSWORD_CUSTOM_REGEX, "", "Configure a custom regular expression that a password must match"));
    props.add(new GlobalProperty(GP_PASSWORD_MINIMUM_LENGTH, "8", "Configure the minimum length required of all passwords"));
    props.add(new GlobalProperty(GP_PASSWORD_REQUIRES_DIGIT, "true", "Configure whether passwords must contain at least one digit", BooleanDatatype.class, null));
    props.add(new GlobalProperty(GP_PASSWORD_REQUIRES_NON_DIGIT, "true", "Configure whether passwords must contain at least one non-digit", BooleanDatatype.class, null));
    props.add(new GlobalProperty(GP_PASSWORD_REQUIRES_UPPER_AND_LOWER_CASE, "true", "Configure whether passwords must contain both upper and lower case characters", BooleanDatatype.class, null));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_IGNORE_MISSING_NONLOCAL_PATIENTS, "false", "If true, hl7 messages for patients that are not found and are non-local will silently be dropped/ignored", BooleanDatatype.class, null));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_SHOW_PATIENT_NAME, "false", "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.", BooleanDatatype.class, null));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_DEFAULT_THEME, "", "Default theme for users.  OpenMRS ships with themes of 'green', 'orange', 'purple', and 'legacy'"));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_HL7_ARCHIVE_DIRECTORY, HL7Constants.HL7_ARCHIVE_DIRECTORY_NAME, "The default name or absolute path for the folder where to write the hl7_in_archives."));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_REPORT_BUG_URL, "http://errors.openmrs.org/scrap", "The openmrs url where to submit bug reports"));
    props.add(new GlobalProperty(GP_SEARCH_WIDGET_BATCH_SIZE, "200", "The maximum number of search results that are returned by an ajax call"));
    props.add(new GlobalProperty(GP_SEARCH_WIDGET_IN_SERIAL_MODE, "false", "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", BooleanDatatype.class, null));
    props.add(new GlobalProperty(GP_SEARCH_WIDGET_DELAY_INTERVAL, "300", "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"));
    props.add(new GlobalProperty(GP_SEARCH_DATE_DISPLAY_FORMAT, null, "Date display format to be used to display the date somewhere in the UI i.e the search widgets and autocompletes"));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_DEFAULT_LOCATION_NAME, "Unknown Location", "The name of the location to use as a system default"));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_PATIENT_IDENTIFIER_SEARCH_MATCH_MODE, GLOBAL_PROPERTY_PATIENT_SEARCH_MATCH_EXACT, "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."));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_PATIENT_SEARCH_MATCH_MODE, GLOBAL_PROPERTY_PATIENT_SEARCH_MATCH_START, "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."));
    props.add(new GlobalProperty(GP_ENABLE_CONCEPT_MAP_TYPE_MANAGEMENT, "false", "Enables or disables management of concept map types", BooleanDatatype.class, null));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_ENABLE_VISITS, "true", "Set to true to enable the Visits feature. This will replace the 'Encounters' tab with a 'Visits' tab on the dashboard.", BooleanDatatype.class, null));
    props.add(new GlobalProperty(GP_VISIT_ASSIGNMENT_HANDLER, ExistingVisitAssignmentHandler.class.getName(), "Set to the name of the class responsible for assigning encounters to visits."));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_APPLICATION_NAME, "OpenMRS", "The name of this application, as presented to the user, for example on the login and welcome pages."));
    props.add(new GlobalProperty(GP_ENCOUNTER_TYPE_TO_VISIT_TYPE_MAPPING, "", "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"));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_ENCOUNTER_TYPES_LOCKED, "false", "saving, retiring or deleting an Encounter Type is not permitted, if true", BooleanDatatype.class, null));
    props.add(new GlobalProperty(GP_DASHBOARD_PROVIDER_DISPLAY_ENCOUNTER_ROLES, "", "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."));
    props.add(new GlobalProperty(GP_SEARCH_WIDGET_MAXIMUM_RESULTS, "2000", "Specifies the maximum number of results to return from a single search in the search widgets"));
    props.add(new GlobalProperty(GP_DASHBOARD_MAX_NUMBER_OF_ENCOUNTERS_TO_SHOW, "3", "An integer which, if specified, would determine the maximum number of encounters to display on the encounter tab of the patient dashboard."));
    props.add(new GlobalProperty(GP_VISIT_TYPES_TO_AUTO_CLOSE, "", "comma-separated list of the visit type(s) to automatically close"));
    props.add(new GlobalProperty(GP_ALLOWED_FAILED_LOGINS_BEFORE_LOCKOUT, "7", "Maximum number of failed logins allowed after which username is locked out"));
    props.add(new GlobalProperty(GP_DEFAULT_CONCEPT_MAP_TYPE, "NARROWER-THAN", "Default concept map type which is used when no other is set"));
    props.add(new GlobalProperty(GP_CONCEPT_DRUG_DOSAGE_FORM_CONCEPT_CLASSES, "", "A comma-separated list of the allowed concept classes for the dosage form field of the concept drug management form."));
    props.add(new GlobalProperty(GP_CONCEPT_DRUG_ROUTE_CONCEPT_CLASSES, "", "A comma-separated list of the allowed concept classes for the route field of the concept drug management form."));
    props.add(new GlobalProperty(GP_CASE_SENSITIVE_DATABASE_STRING_COMPARISON, "false", "Indicates whether database string comparison is case sensitive or not. Setting this to false for MySQL with a case insensitive collation improves search performance."));
    props.add(new GlobalProperty(GP_DASHBOARD_METADATA_CASE_CONVERSION, "", "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."));
    props.add(new GlobalProperty(GP_ALLERGY_ALLERGEN_CONCEPT_CLASSES, "Drug,MedSet", "A comma-separated list of the allowed concept classes for the allergen field of the allergy dialog"));
    props.add(new GlobalProperty(GP_ALLERGY_REACTION_CONCEPT_CLASSES, "Symptom", "A comma-separated list of the allowed concept classes for the reaction field of the allergy dialog"));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_USER_REQUIRE_EMAIL_AS_USERNAME, "false", "Indicates whether a username must be a valid e-mail or not.", BooleanDatatype.class, null));
    props.add(new GlobalProperty(GP_SEARCH_INDEX_VERSION, "", "Indicates the index version. If it is blank, the index needs to be rebuilt."));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_ALLOW_OVERLAPPING_VISITS, "true", "true/false whether or not to allow visits of a given patient to overlap", BooleanDatatype.class, null));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_FORMS_LOCKED, "false", "Set to a value of true if you do not want any changes to be made on forms, else set to false."));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_DRUG_ORDER_REQUIRE_DRUG, "false", "Set to value true if you need to specify a formulation(Drug) when creating a drug order."));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_PERSON_ATRIBUTE_TYPES_LOCKED, "false", "Set to a value of true if you do not want allow editing person attribute types, else set to false."));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_PATIENT_IDENTIFIER_TYPES_LOCKED, "false", "Set to a value of true if you do not want allow editing patient identifier types, else set to false."));
    props.add(new GlobalProperty(GP_NEXT_ORDER_NUMBER_SEED, "1", "The next order number available for assignment"));
    props.add(new GlobalProperty(GP_ORDER_NUMBER_GENERATOR_BEAN_ID, "", "Specifies spring bean id of the order generator to use when assigning order numbers"));
    props.add(new GlobalProperty(GP_DRUG_ROUTES_CONCEPT_UUID, "", "Specifies the uuid of the concept set where its members represent the possible drug routes"));
    props.add(new GlobalProperty(GP_DRUG_DOSING_UNITS_CONCEPT_UUID, "", "Specifies the uuid of the concept set where its members represent the possible drug dosing units"));
    props.add(new GlobalProperty(GP_DRUG_DISPENSING_UNITS_CONCEPT_UUID, "", "Specifies the uuid of the concept set where its members represent the possible drug dispensing units"));
    props.add(new GlobalProperty(GP_DURATION_UNITS_CONCEPT_UUID, "", "Specifies the uuid of the concept set where its members represent the possible duration units"));
    props.add(new GlobalProperty(GP_TEST_SPECIMEN_SOURCES_CONCEPT_UUID, "", "Specifies the uuid of the concept set where its members represent the possible test specimen sources"));
    props.add(new GlobalProperty(GP_UNKNOWN_PROVIDER_UUID, "", "Specifies the uuid of the Unknown Provider account"));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_PROVIDER_SEARCH_MATCH_MODE, "EXACT", "Specifies how provider identifiers are matched while searching for providers. Valid values are START,EXACT, END or ANYWHERE"));
    props.add(new GlobalProperty(GLOBAL_PROPERTY_PERSON_ATTRIBUTE_SEARCH_MATCH_MODE, GLOBAL_PROPERTY_PERSON_ATTRIBUTE_SEARCH_MATCH_EXACT, "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."));
    props.add(new GlobalProperty(GP_DISABLE_VALIDATION, "false", "Disables validation of OpenMRS Objects. Only takes affect on next restart. Warning: only do this is you know what you are doing!"));
    props.add(new GlobalProperty("allergy.concept.severity.mild", "1498AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "UUID for the MILD severity concept"));
    props.add(new GlobalProperty("allergy.concept.severity.moderate", "1499AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "UUID for the MODERATE severity concept"));
    props.add(new GlobalProperty("allergy.concept.severity.severe", "1500AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "UUID for the SEVERE severity concept"));
    props.add(new GlobalProperty("allergy.concept.allergen.food", "162553AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "UUID for the food allergens concept"));
    props.add(new GlobalProperty("allergy.concept.allergen.drug", "162552AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "UUID for the drug allergens concept"));
    props.add(new GlobalProperty("allergy.concept.allergen.environment", "162554AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "UUID for the environment allergens concept"));
    props.add(new GlobalProperty("allergy.concept.reactions", "162555AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "UUID for the allergy reactions concept"));
    props.add(new GlobalProperty(GP_ALLERGEN_OTHER_NON_CODED_UUID, "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "UUID for the allergy other non coded concept"));
    props.add(new GlobalProperty("allergy.concept.unknown", "1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "UUID for the allergy unknown concept"));
    props.add(new GlobalProperty(GP_DRUG_ORDER_DRUG_OTHER, "", "Specifies the uuid of the concept which represents drug other non coded"));
    props.addAll(ModuleFactory.getGlobalProperties());
    return props;
}
Also used : BooleanDatatype(org.openmrs.customdatatype.datatype.BooleanDatatype) ArrayList(java.util.ArrayList) GlobalProperty(org.openmrs.GlobalProperty)

Aggregations

GlobalProperty (org.openmrs.GlobalProperty)107 Test (org.junit.Test)80 BaseContextSensitiveTest (org.openmrs.test.BaseContextSensitiveTest)77 Locale (java.util.Locale)14 OrderUtilTest (org.openmrs.order.OrderUtilTest)14 Encounter (org.openmrs.Encounter)12 ArrayList (java.util.ArrayList)11 User (org.openmrs.User)11 Patient (org.openmrs.Patient)10 BindException (org.springframework.validation.BindException)10 DrugOrder (org.openmrs.DrugOrder)9 Errors (org.springframework.validation.Errors)9 AdministrationService (org.openmrs.api.AdministrationService)8 CareSetting (org.openmrs.CareSetting)7 OrderType (org.openmrs.OrderType)7 Date (java.util.Date)6 EncounterType (org.openmrs.EncounterType)5 APIException (org.openmrs.api.APIException)4 MutableMessageSource (org.openmrs.messagesource.MutableMessageSource)4 MutableResourceBundleMessageSource (org.openmrs.messagesource.impl.MutableResourceBundleMessageSource)4