Package org.openmrs

Examples of org.openmrs.EncounterType


  @Test
  public void shouldReturnObsGroupSchemaCorrectly() throws Exception {
    Form form = new Form();
    HtmlForm htmlform = new HtmlForm();
    htmlform.setForm(form);
    form.setEncounterType(new EncounterType());
    htmlform.setDateChanged(new Date());
    htmlform.setXmlData(new TestUtil().loadXmlFromFile(XML_DATASET_PATH + "obsGroupSchemaTest.xml"));
    FormEntrySession session = new FormEntrySession(HtmlFormEntryUtil.getFakePerson(), htmlform, null);
        session.getHtmlToDisplay();
    HtmlFormSchema hfs = session.getContext().getSchema();
View Full Code Here


   * @should find a encounter type by its uuid
   * @should return null otherwise
   */
  public static EncounterType getEncounterType(String id) {
   
    EncounterType encounterType = null;
   
    if (StringUtils.isNotBlank(id)) {
      id = id.trim();
      // see if this is parseable int; if so, try looking up by id
      try {
View Full Code Here

            encounterTypeErrorWidget = new ErrorWidget();
            if (parameters.get("types") != null) {
                List<EncounterType> encounterTypes = new ArrayList<EncounterType>();
                String[] temp = ((String) parameters.get("types")).split(",");
                for (String s : temp) {
                    EncounterType type = HtmlFormEntryUtil.getEncounterType(s);
                    if (type == null) {
                        throw new RuntimeException("Cannot find encounter type: " + s);
                    }
                    encounterTypes.add(type);
                }

               encounterTypeWidget.setOptions(encounterTypes);
            }
            // Set default values

            EncounterType defaultEncounterType = null;
            if (context.getExistingEncounter() != null) {
                defaultEncounterType = context.getExistingEncounter().getEncounterType();
            } else {
                String defaultTypeId = (String) parameters.get("default");
                if (StringUtils.hasText(defaultTypeId)) {
View Full Code Here

            Object value = locationWidget.getValue(session.getContext(), submission);
            Location location = (Location) HtmlFormEntryUtil.convertToType(value.toString().trim(), Location.class);
            session.getSubmissionActions().getCurrentEncounter().setLocation(location);
        }
        if (encounterTypeWidget != null) {
            EncounterType encounterType = (EncounterType) encounterTypeWidget.getValue(session.getContext(), submission);
            session.getSubmissionActions().getCurrentEncounter().setEncounterType(encounterType);
        }
        if (voidWidget != null) {
            if ("true".equals(voidWidget.getValue(session.getContext(), submission))) {
                session.setVoidEncounter(true);
View Full Code Here

   * @return the all the encounters of the specified type
   * @should return all the encounters of the specified type
   * @should return all encounters if no type specified
   */
    public List<Encounter> allEncounters(String encounterTypeId){
    EncounterType encounterType = HtmlFormEntryUtil.getEncounterType(encounterTypeId);
    return getAllEncounters(encounterType);
    }
View Full Code Here

   * @return the most recent encounter of the specified type
   * @should return the most recent encounter of the specified type
   * @should return the most recent encounter of any type if no type specified
   */
  public Encounter latestEncounter(String encounterTypeId){
    EncounterType encounterType = null;
    if (StringUtils.isNotEmpty(encounterTypeId)) {
      encounterType = HtmlFormEntryUtil.getEncounterType(encounterTypeId);     
    }
   
    return getLatestEncounter(encounterType);
View Full Code Here

    TestUtil.addObs(e, 2474, Context.getConceptService().getConcept(656), date); //matches
   
    Form form = new Form();
    HtmlForm htmlform = new HtmlForm();
    htmlform.setForm(form);
    form.setEncounterType(new EncounterType());
    htmlform.setDateChanged(new Date());
    htmlform.setXmlData(new TestUtil().loadXmlFromFile(XML_DATASET_PATH
            + "returnSectionsAndConceptsInSectionsTestFormWithGroups.xml"));
    HtmlFormEntryUtil.voidEncounterByHtmlFormSchema(e, htmlform, null);
   
View Full Code Here

    Context.getEncounterService().saveEncounter(e);
   
    Form form = new Form();
    HtmlForm htmlform = new HtmlForm();
    htmlform.setForm(form);
    form.setEncounterType(new EncounterType());
    htmlform.setDateChanged(new Date());
    htmlform.setXmlData(new TestUtil().loadXmlFromFile(XML_DATASET_PATH
            + "returnSectionsAndConceptsInSectionsTestFormWithGroups.xml"));
    HtmlFormEntryUtil.voidEncounterByHtmlFormSchema(e, htmlform, null);
   
View Full Code Here

    Context.getEncounterService().saveEncounter(e);
   
    Form form = new Form();
    HtmlForm htmlform = new HtmlForm();
    htmlform.setForm(form);
    form.setEncounterType(new EncounterType());
    htmlform.setDateChanged(new Date());
    htmlform.setXmlData(new TestUtil().loadXmlFromFile(XML_DATASET_PATH
            + "returnSectionsAndConceptsInSectionsTestFormWithGroups.xml"));
   
    HtmlFormEntryUtil.voidEncounterByHtmlFormSchema(e, htmlform, "test void reason");
View Full Code Here

    Context.getEncounterService().saveEncounter(e);
   
    Form form = new Form();
    HtmlForm htmlform = new HtmlForm();
    htmlform.setForm(form);
    form.setEncounterType(new EncounterType());
    htmlform.setDateChanged(new Date());
    htmlform.setXmlData(new TestUtil().loadXmlFromFile(XML_DATASET_PATH
            + "returnSectionsAndConceptsInSectionsTestFormWithGroups.xml"));
   
    HtmlFormEntryUtil.voidEncounterByHtmlFormSchema(e, htmlform, null);
View Full Code Here

TOP

Related Classes of org.openmrs.EncounterType

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.