Package org.openmrs

Examples of org.openmrs.Location


    Assert.assertFalse(formClone.getXmlData().contains(existingRoleName));
   
    PatientIdentifierType incoming1 = Context.getPatientService().getPatientIdentifierType(2)// Old Identifier Type
    PatientIdentifierType existing1 = Context.getPatientService().getPatientIdentifierType(4); // Social Security Number
   
    Location incoming2 = Context.getLocationService().getLocation(3)// Never Never Land
    Location existing2 = Context.getLocationService().getLocation(2); // Xanadu
   
    Drug incoming3 = Context.getConceptService().getDrug(3)// Aspirin
    Drug existing3 = Context.getConceptService().getDrug(11); // NyQuil
   
    Role incoming4 = Context.getUserService().getRole(incomingRoleName);
View Full Code Here


          }
        }

        if (initialValue != null) {
          if (isLocationObs) {
            Location l = HtmlFormEntryUtil.getLocation(initialValue, context);
            if (l == null) {
              throw new RuntimeException("Cannot find Location: " + initialValue);
            }
            valueWidget.setInitialValue(l);
          } else if ("person".equals(parameters.get("style"))) {
View Full Code Here

    @Test
    @Verifies(value="shouldReturnMetadataNameIfNoFormatterPresent", method="format(OpenmrsMetadata md, Locale locale)")
    public void sholdReturnMetadataNameIfNoFormatterPresent() {

        Location location = new Location();
        location.setName("Test name");

        Assert.assertTrue(HtmlFormEntryUtil.format(location, Locale.US).equals("Test name"));
    }
View Full Code Here

                        if (widgetClass != null) {

                            Object returnedObj = HtmlFormEntryUtil.convertToType(val.trim(), widgetClass);

                            if (widgetClass.getSimpleName().equals("Location")) {
                                Location location = null;
                                if (returnedObj != null) {
                                    location = (Location) returnedObj;
                                } else {
                                    //This should typically never happen,why is there no location with this id, we
                                    //should set val(locationId) to blank so that the hidden form field is blank too
                                    val = "";
                                }

                                sb.append("$j('#" + widgetFieldName + "').val(\""
                                        + (location == null ? "" : JavaScriptUtils.javaScriptEscape(location.getName())) + "\");\n");
                                sb.append("$j('#" + widgetFieldName + "_hid" + "').val(\""
                                        + (location == null ? "" : JavaScriptUtils.javaScriptEscape(location.getId().toString())) + "\");\n");
                                sb.append("$j('#" + widgetFieldName + "').change();\n");

                            } else if (widgetClass.getSimpleName().equals("Person")) {
                                Person provider = null;
                                if (returnedObj != null) {
View Full Code Here

      Provider pSender = Context.getProviderService().getProviderByUuid(post.get("providerSent").toString());
      raxaAlert.setProviderSentId(pSender.getId());
      raxaAlert.setProviderSent(pSender);
    }
    if (post.get("toLocation") != null) {
      Location toLocation = Context.getLocationService().getLocationByUuid(post.get("toLocation").toString());
      raxaAlert.setToLocationId(toLocation.getId());
      raxaAlert.setToLocation(toLocation);
    }
    if (post.get("fromLocation") != null) {
      Location fromLocation = Context.getLocationService().getLocationByUuid(post.get("fromLocation").toString());
      raxaAlert.setFromLocationId(fromLocation.getId());
      raxaAlert.setFromLocation(fromLocation);
    }
    if (post.get("patient") != null) {
      Patient patient = Context.getPatientService().getPatientByUuid(post.get("patient").toString());
      raxaAlert.setPatientId(patient.getId());
View Full Code Here

      pSentObj.add("uuid", pSent.getUuid());
      pSentObj.add("display", pSent.getName());
    }
    obj.add("providerSent", pSentObj);
    SimpleObject toLocationObj = new SimpleObject();
    Location toLocation = rAlert.getToLocation();
    if (toLocation != null) {
      toLocationObj.add("uuid", toLocation.getUuid());
      toLocationObj.add("display", toLocation.getName());
    }
    obj.add("toLocation", toLocationObj);
    SimpleObject fromLocationObj = new SimpleObject();
    Location fromLocation = rAlert.getFromLocation();
    if (fromLocation != null) {
      fromLocationObj.add("uuid", fromLocation.getUuid());
      fromLocationObj.add("display", fromLocation.getName());
    }
    obj.add("fromLocation", fromLocationObj);
    obj.add("alertType", rAlert.getAlertType());
    obj.add("defaultTask", rAlert.getDefaultTask());
    obj.add("seen", rAlert.getSeen());
View Full Code Here

    //the return value can only choose encounters from this list (if not null)
    List<Encounter> inListEncounters = null;
    //the return value can not contain any patients from this list
    List<Patient> notInListPatients = new ArrayList<Patient>();
    List<Encounter> notInListEncounters = new ArrayList<Encounter>();
    Location location = null;
    String containsOrderType = "";
    String[] queryFields = query.split("&");
    //if we have an encountertype in our search query, set it
    for (int i = 0; i < queryFields.length; i++) {
      if (queryFields[i].indexOf("encounterType=") != -1) {
View Full Code Here

      Provider p = Context.getProviderService().getProviderByUuid(post.get("provider").toString());
      drugInventory.setProviderId(p.getId());
      drugInventory.setProvider(p);
    }
    if (post.get("location") != null) {
      Location l = Context.getLocationService().getLocationByUuid(post.get("location").toString());
      drugInventory.setLocationId(l.getId());
      drugInventory.setLocation(l);
    }
    if (post.get("drugPurchaseOrder") != null) {
      DrugPurchaseOrder dPO = Context.getService(DrugPurchaseOrderService.class).getDrugPurchaseOrderByUuid(
          post.get("drugPurchaseOrder").toString());
View Full Code Here

      pObj.add("uuid", p.getUuid());
      pObj.add("display", p.getName());
    }
    obj.add("provider", pObj);
    SimpleObject lObj = new SimpleObject();
    Location l = di.getLocation();
    if (l != null) {
      lObj.add("uuid", l.getUuid());
      lObj.add("display", l.getName());
    }
    obj.add("location", lObj);
    SimpleObject dPOObj = new SimpleObject();
    DrugPurchaseOrder dPO = di.getDrugPurchaseOrder();
    if (dPO != null) {
View Full Code Here

      person.setBirthdateEstimated(Boolean.TRUE);
    }
    //Location location = Context.getLocationService().getLocationByUuid(post.get("location").toString());
    Integer userLocation = Integer.parseInt(Context.getPersonService().getPersonByUuid(
        Context.getAuthenticatedUser().getPerson().getUuid()).getAttribute("Health Center").getValue());
    Location location = Context.getLocationService().getLocation(userLocation);
    PersonAttribute locationAttribute = new PersonAttribute();
    locationAttribute.setAttributeType(Context.getPersonService().getPersonAttributeTypeByName("Health Center"));
    locationAttribute.setValue(location.getId().toString());
    person.addAttribute(locationAttribute);
    if (post.get("attributes") != null) {
      addAttributes(person, post);
    }
    if (post.get("addresses") != null) {
View Full Code Here

TOP

Related Classes of org.openmrs.Location

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.