Tabnine Logo
AdministrationService.getGlobalPropertyValue
Code IndexAdd Tabnine to your IDE (free)

How to use
getGlobalPropertyValue
method
in
org.openmrs.api.AdministrationService

Best Java code snippets using org.openmrs.api.AdministrationService.getGlobalPropertyValue (Showing top 8 results out of 315)

origin: openmrs/openmrs-core

/**
 * @should recognise short name
 * @should recognise long name
 */
Boolean isShortName(String name) {
  Integer minChars = Context.getAdministrationService().getGlobalPropertyValue(
    OpenmrsConstants.GLOBAL_PROPERTY_MIN_SEARCH_CHARACTERS,
    OpenmrsConstants.GLOBAL_PROPERTY_DEFAULT_MIN_SEARCH_CHARACTERS);
  
  if (name != null && name.length() < minChars) {
    return Boolean.TRUE;
    
  } else {
    return Boolean.FALSE;
  }
}

origin: openmrs/openmrs-core

String dateTimeFormat = Context.getAdministrationService().getGlobalPropertyValue(
  OpenmrsConstants.GP_SEARCH_DATE_DISPLAY_FORMAT, null);
if (StringUtils.isEmpty(dateTimeFormat)) {
String timeFormat = Context.getAdministrationService().getGlobalPropertyValue(
  OpenmrsConstants.GP_SEARCH_DATE_DISPLAY_FORMAT, null);
if (StringUtils.isEmpty(timeFormat)) {
String formatValue = Context.getAdministrationService().getGlobalPropertyValue(
  OpenmrsConstants.GP_SEARCH_DATE_DISPLAY_FORMAT, "");
if (StringUtils.isEmpty(formatValue)) {
origin: openmrs/openmrs-core

@Test(expected = IllegalArgumentException.class)
public void getGlobalPropertyValue_shouldFailIfDefaultValueIsNull() {
  adminService.getGlobalPropertyValue("valid.double", null);
}
origin: openmrs/openmrs-core

String value = Context.getAdministrationService().getGlobalPropertyValue(
  OpenmrsConstants.GP_ENCOUNTER_TYPE_TO_VISIT_TYPE_MAPPING, "");
origin: openmrs/openmrs-core

@Test
public void getGlobalPropertyValue_shouldReturnDefaultValueForMissingProperty() {
  // put the global property into the database
  executeDataSet("org/openmrs/api/include/AdministrationServiceTest-globalproperties.xml");
  
  Object value = adminService.getGlobalPropertyValue("does.not.exist", 1234);
  
  assertEquals(1234, value);
}

origin: openmrs/openmrs-core

@Test
public void getGlobalPropertyValue_shouldReturnValueInTheSpecifiedIntegerType() {
  // put the global property into the database
  executeDataSet("org/openmrs/api/include/AdministrationServiceTest-globalproperties.xml");
  
  Object value = adminService.getGlobalPropertyValue("valid.integer", 4);
  
  assertTrue(value instanceof Integer);
  assertEquals(1234, value);
}

origin: openmrs/openmrs-core

@Test
public void getGlobalPropertyValue_shouldReturnValueInTheSpecifiedDoubleType() {
  // put the global property into the database
  executeDataSet("org/openmrs/api/include/AdministrationServiceTest-globalproperties.xml");
  
  Object retValue = adminService.getGlobalPropertyValue("valid.double", 4.34);
  
  assertTrue(retValue instanceof Double);
  assertEquals(1234.54, retValue);
}

origin: openmrs/openmrs-core

private void validateForRequireDrug(Errors errors, DrugOrder order) {
  //Reject if global property is set to specify a formulation for drug order
  boolean requireDrug = Context.getAdministrationService().getGlobalPropertyValue(
      OpenmrsConstants.GLOBAL_PROPERTY_DRUG_ORDER_REQUIRE_DRUG, false);
  OrderService orderService = Context.getOrderService();
  if(requireDrug){
    if(order.getConcept() != null && OpenmrsUtil.nullSafeEquals(orderService.getNonCodedDrugConcept(), order.getConcept())){
      if(order.getDrug() == null && !order.isNonCodedDrug()){
        errors.rejectValue("drugNonCoded", "DrugOrder.error.drugNonCodedIsRequired");
      }
      else if(order.getDrug() != null){
        errors.rejectValue("concept", "DrugOrder.error.onlyOneOfDrugOrNonCodedShouldBeSet");
      }
    }else{
      if(order.getDrug() == null && !order.isNonCodedDrug()){
        errors.rejectValue("drug", "DrugOrder.error.drugIsRequired");
      }
      else if(order.getDrug() != null && order.isNonCodedDrug()){
        errors.rejectValue("concept", "DrugOrder.error.onlyOneOfDrugOrNonCodedShouldBeSet");
      }
    }
  }
}

org.openmrs.apiAdministrationServicegetGlobalPropertyValue

Javadoc

Returns a global property according to the type specified

Popular methods of AdministrationService

  • saveGlobalProperty
    Save the given global property to the database
  • getGlobalProperty
  • getGlobalPropertyObject
    Gets the global property that has the given propertyName
  • getAllGlobalProperties
    Get a list of all global properties in the system
  • getAllowedLocales
    Gets the list of locales which the administrator has allowed for use on the system. This is specifie
  • executeSQL
    Runs the sql on the database. If selectOnly is flagged then any non-select sql statements will be re
  • getGlobalPropertiesByPrefix
    Gets all global properties that begin with prefix.
  • getGlobalPropertyByUuid
    Get a global property by its uuid. There should be only one of these in the database (well, in the w
  • purgeGlobalProperty
    Completely remove the given global property from the database
  • addGlobalPropertyListener
    Allows code to be notified when a global property is created/edited/deleted.
  • getSearchLocales
    Returns a list of locales used by the user when searching.
  • getSystemVariables
    Get a listing or important variables used in openmrs
  • getSearchLocales,
  • getSystemVariables,
  • setGlobalProperty,
  • setImplementationId,
  • validate,
  • getGlobalPropertiesBySuffix,
  • getImplementationId,
  • getMaximumPropertyLength,
  • getPresentationLocales

Popular in Java

  • Making http post requests using okhttp
  • compareTo (BigDecimal)
  • notifyDataSetChanged (ArrayAdapter)
  • getResourceAsStream (ClassLoader)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • Path (java.nio.file)
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now