Package org.openmrs

Examples of org.openmrs.GlobalProperty


  @Test
  public void encounterLocationTag_shouldSupportDefaultSelectyByGlobalProperty() throws Exception {
    String GP_NAME = "kenyaemr.defaultLocation";
    String GP_VALUE = "2";
    Assert.assertNotNull(Context.getLocationService().getLocation(Integer.valueOf(GP_VALUE)));
    Context.getAdministrationService().saveGlobalProperty(new GlobalProperty(GP_NAME, GP_VALUE));
   
    String htmlform = "<htmlform><encounterLocation default=\"GlobalProperty:" + GP_NAME + "\"/></htmlform>";
    FormEntrySession session = new FormEntrySession(null, htmlform, null);
   
    Matcher matcher = Pattern.compile("<option.+?value=\"(.+?)\".+?selected=\"true\".*?>").matcher(session.getHtmlToDisplay());
 
View Full Code Here


   * @throws Exception
   */
  @Test
  public void testCreatePatientBirthdateByBirthdateAndAgeAgainstNonStandardDateFormat() throws Exception {
   
    GlobalProperty gp = new GlobalProperty(HtmlFormEntryConstants.GP_DATE_FORMAT, "MM-yyyy-dd");
    Context.getAdministrationService().saveGlobalProperty(gp);
    Context.getUserContext().setLocale(new Locale("en", "US"));
   
    final Integer expectedAge = 40;
    Calendar cal = Calendar.getInstance();
View Full Code Here

 
 
 
  private void setupAddressTemplate() {
   
    GlobalProperty property = new GlobalProperty ("layout.address.format", "<org.openmrs.layout.web.address.AddressTemplate>" +
                                          "<nameMappings class=\"properties\">"+
                                          "<property name=\"postalCode\" value=\"Location.postalCode\"/>" +
                                          "<property name=\"address1\" value=\"Location.address1\"/>" +
                                          "<property name=\"stateProvince\" value=\"Location.stateProvince\"/>" +
                                          "<property name=\"cityVillage\" value=\"Location.cityVillage\"/>" +
View Full Code Here

  @Before
    public void setupDatabase() throws Exception {
    executeDataSet(XML_DATASET_PATH + new TestUtil().getTestDatasetFilename(XML_REGRESSION_TEST_DATASET));
   
    String xml = (new TestUtil()).loadXmlFromFile(XML_DATASET_PATH + XML_HTML_FORM_ENTRY_REGIMEN_UTIL_TEST_DATASET)
    GlobalProperty gp = new GlobalProperty(OpenmrsConstants.GLOBAL_PROPERTY_STANDARD_DRUG_REGIMENS);
    gp.setPropertyValue(xml);
    Context.getAdministrationService().saveGlobalProperty(gp);
    }
View Full Code Here

  public void setupDatabase() throws Exception {
    executeDataSet(XML_DATASET_PATH + new TestUtil().getTestDatasetFilename(XML_REGRESSION_TEST_DATASET));
    executeDataSet(XML_DATASET_PATH + new TestUtil().getTestDatasetFilename(XML_DRUG_ORDER_ELEMENT_DATASET));
   
    String xml = (new TestUtil()).loadXmlFromFile(XML_DATASET_PATH + XML_HTML_FORM_ENTRY_REGIMEN_UTIL_TEST_DATASET)
    GlobalProperty gp = new GlobalProperty(OpenmrsConstants.GLOBAL_PROPERTY_STANDARD_DRUG_REGIMENS);
    gp.setPropertyValue(xml);
    Context.getAdministrationService().saveGlobalProperty(gp);
  }
View Full Code Here

  @Test
  public void shouldRespectClassesNotToExportGlobalProperty() throws Exception {

    // include this set so that we get the mapping concept
    executeDataSet(XML_DATASET_PATH + new TestUtil().getTestDatasetFilename(XML_HTML_FORM_ENTRY_TEST_DATASET));
    Context.getAdministrationService().saveGlobalProperty(new GlobalProperty(HtmlFormEntryConstants.GP_CLASSES_NOT_TO_EXPORT_WITH_MDS, "org.openmrs.Program"));

    HtmlForm form = new HtmlForm();
    form.setXmlData(new TestUtil().loadXmlFromFile(XML_DATASET_PATH + "metadataSharingTestForm.xml"));

    HtmlFormExporter exporter = new HtmlFormExporter(form);
View Full Code Here

    public void setupDatabase() throws Exception {
    executeDataSet(XML_DATASET_PATH + new TestUtil().getTestDatasetFilename(XML_REGRESSION_TEST_DATASET));
    executeDataSet(XML_DATASET_PATH + new TestUtil().getTestDatasetFilename(XML_DRUG_ORDER_ELEMENT_DATASET));
   
    String xml = (new TestUtil()).loadXmlFromFile(XML_DATASET_PATH + XML_HTML_FORM_ENTRY_REGIMEN_UTIL_TEST_DATASET)
    GlobalProperty gp = new GlobalProperty(OpenmrsConstants.GLOBAL_PROPERTY_STANDARD_DRUG_REGIMENS);
    gp.setPropertyValue(xml);
    Context.getAdministrationService().saveGlobalProperty(gp);
    }
View Full Code Here

    new RegressionTestHelper() {
     
      @Override
      public void setupRequest(MockHttpServletRequest request, Map<String, String> widgets) {
        // set the appropriate global property to true
        Context.getAdministrationService().saveGlobalProperty(new GlobalProperty("htmlformentry.voidEncounterByHtmlFormSchema", "true"));
      }
     
      @Override
      public String getFormName() {
        return "multipleObsFormToVoid";
View Full Code Here

    new RegressionTestHelper() {
     
      @Override
      public void setupRequest(MockHttpServletRequest request, Map<String, String> widgets) {
        // set the appropriate global property to true
        Context.getAdministrationService().saveGlobalProperty(new GlobalProperty("htmlformentry.voidEncounterByHtmlFormSchema", "false"));
      }
     
      @Override
      public String getFormName() {
        return "multipleObsFormToVoid";
View Full Code Here

TOP

Related Classes of org.openmrs.GlobalProperty

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.