Package org.openmrs

Examples of org.openmrs.Encounter


          return "obsGroupsWithSameGroupingConceptButDifferentMemberConceptsForm";
        }

        @Override
        public Encounter getEncounterToView() throws Exception {
          Encounter e = new Encounter();
          e.setPatient(getPatient());
          Date date = Context.getDateFormat().parse("01/02/2003");
          e.setDateCreated(new Date());
          e.setEncounterDatetime(date);
          e.setLocation(Context.getLocationService().getLocation(2));
          e.setProvider(Context.getPersonService().getPerson(502));

          // first create two ALLERGY CONSTRUCT obsgroups, both with ALLERGY CODED obs, but with different answer values
          TestUtil.addObsGroup(e, 7, new Date(), 8, Context.getConceptService().getConcept(1001), new Date());
          TestUtil.addObsGroup(e, 7, new Date(), 8, Context.getConceptService().getConcept(1002), new Date());
View Full Code Here


          return "multipleObsGroupForm";
        }
 
        @Override
        public Encounter getEncounterToView() throws Exception {
          Encounter e = new Encounter();
          e.setPatient(getPatient());
          Date date = Context.getDateFormat().parse("01/02/2003");
          e.setDateCreated(new Date());
          e.setEncounterDatetime(date);
          e.setLocation(Context.getLocationService().getLocation(2));
          e.setProvider(Context.getPersonService().getPerson(502));
 
          // create two ALLERGY CONSTRUCT obsgroups, with different text values, one of 01/02/2003, and one with the date set to null
          TestUtil.addObsGroup(e, 7, new Date(), 8,"Dogs", new Date(), 1119, date, new Date());
          TestUtil.addObsGroup(e, 7, new Date(), 8, "Cats", new Date(), 1119, null, new Date());
 
View Full Code Here

        return "multiLevelObsGroup1";
      }

      @Override
      public Encounter getEncounterToView() throws Exception {
        Encounter e = new Encounter();
        e.setPatient(getPatient());
        Date date = Context.getDateFormat().parse("01/02/2003");
        e.setDateCreated(new Date());
        e.setEncounterDatetime(date);
        e.setLocation(Context.getLocationService().getLocation(2));
        e.setProvider(Context.getPersonService().getPerson(502));

        // first create DST parent group
        Obs dstParent = TestUtil.createObs(e, 3040, null, date);
        e.addObs(dstParent);

        Obs resultParent = TestUtil.createObs(e, 3025, null, date);
        dstParent.addGroupMember(resultParent);
        Obs resultParent2 = TestUtil.createObs(e, 3025, null, date);
        dstParent.addGroupMember(resultParent2);
        Obs resultParent3 = TestUtil.createObs(e, 3025, null, date);
        dstParent.addGroupMember(resultParent3);

        Obs dstStartDate = TestUtil.createObs(e, 3032, date, date);
        dstParent.addGroupMember(dstStartDate);

        //let's make rifampin susceptible -- 2474 is susceptible
        Obs drugResult = TestUtil.createObs(e, 2474, Context.getConceptService().getConcept(767), date);
        resultParent.addGroupMember(drugResult);

        //let's make INH resistant 1441 is resistant
        Obs drugResult2 = TestUtil.createObs(e, 1441, Context.getConceptService().getConcept(656), date);
        resultParent2.addGroupMember(drugResult2);
        //and add colonies for just INH
        Obs colonies1 = TestUtil.createObs(e, 3016, 200, date);
        resultParent2.addGroupMember(colonies1);

        //let's make ETHIO intermediate
        Obs drugResult4 = TestUtil.createObs(e, 3017, Context.getConceptService().getConcept(1414), date);
        resultParent3.addGroupMember(drugResult4);
        //and add colonies for ETHIO
        Obs colonies3 = TestUtil.createObs(e, 3016, 500, date);
        resultParent3.addGroupMember(colonies3);

        //THINGS THAT SHOULD BE IGNORED:
        //THESE TEST THE BEHAVIOR THAT IF AN OBS GROUP CONCEPT IS UNIQUE AT THAT LEVEL IN AN OBS GROUP HIERARCHY,
        //IT WILL BE RETURNED EVEN IF THE MEMBER OBS DONT 'SUPPORT' THE obsgroup SCHEMA
        //let's add some 'right' data at the 'wrong' place in the hierarchy:
        //let's put another colonies obs in the wrong place in the hierarchy, with colonies value 400
        Obs colonies2 = TestUtil.createObs(e, 3016, 400, date);
        dstParent.addGroupMember(colonies2);
        //and here's a drug result added directly to the encounter (bypassing the DST parentConstructObs)
        Obs drugResult3 = TestUtil.createObs(e, 3017, Context.getConceptService().getConcept(767), date);
        resultParent3.addGroupMember(drugResult3);
        e.addObs(resultParent3);

        e = Context.getEncounterService().saveEncounter(e);
        return e;
      }
View Full Code Here

        return "singleObsForm2";
      }

      @Override
      public Encounter getEncounterToView() throws Exception {
        Encounter e = new Encounter();
        e.setPatient(getPatient());
        Date date = Context.getDateFormat().parse("01/02/2003");
        e.setDateCreated(new Date());
        e.setEncounterDatetime(date);
        e.setLocation(Context.getLocationService().getLocation(2));
        e.setProvider(Context.getPersonService().getPerson(502));
        TestUtil.addObs(e, 6, "blah blah", null);
        return e;
      }

      @Override
View Full Code Here

      @Override
      public void testBlankFormHtml(String html) {
        TestUtil.assertFuzzyContains("Last weight: 50.0", html);
        TestUtil.assertFuzzyContains("Gender: M", html);
        List<Encounter> encounters = Context.getEncounterService().getEncountersByPatient(getPatient());
        Encounter latestEncounter = encounters.get(encounters.size() - 1);
        TestUtil.assertFuzzyContains("Location: " + latestEncounter.getLocation(), html);
      }
    }.run();
  }
View Full Code Here

        return "singleLocationObsForm";
      }

      @Override
      public Encounter getEncounterToView() throws Exception {
        Encounter e = new Encounter();
        e.setPatient(getPatient());
        Date date = Context.getDateFormat().parse("01/02/2003");
        e.setDateCreated(new Date());
        e.setEncounterDatetime(date);
        e.setLocation(Context.getLocationService().getLocation(2));
        e.setProvider(Context.getPersonService().getPerson(502));
        TestUtil.addObs(e, 19, "2", null); // this is a location
        return e;
      }

      @Override
View Full Code Here

        return "singleLocationObsForm";
      }

      @Override
      public Encounter getEncounterToView() throws Exception {
        Encounter e = new Encounter();
        e.setPatient(getPatient());
        Date date = Context.getDateFormat().parse("01/02/2003");
        e.setDateCreated(new Date());
        e.setEncounterDatetime(date);
        e.setLocation(Context.getLocationService().getLocation(2));
        e.setProvider(Context.getPersonService().getPerson(502));
        TestUtil.addObs(e, 19, "2 - Xanadu", null); // this is a location
        return e;
      }

      @Override
View Full Code Here

        return "multipleObsGroupDifferentAnswerConceptIdForm";
      }

      @Override
      public Encounter getEncounterToView() throws Exception {
        Encounter e = new Encounter();
        e.setPatient(getPatient());
        Date date = Context.getDateFormat().parse("01/02/2003");
        e.setDateCreated(new Date());
        e.setEncounterDatetime(date);
        e.setLocation(Context.getLocationService().getLocation(2));
        e.setProvider(Context.getPersonService().getPerson(502));

        // create three obsgroups with the identical structures but with different answer values for the obs
        TestUtil.addObsGroup(e, 7, new Date(), 1000, Context.getConceptService().getConcept(1002), new Date(), 8, "foo2",
            new Date());
        TestUtil.addObsGroup(e, 7, new Date(), 1000, Context.getConceptService().getConcept(1003), new Date(), 8, "foo3",
View Full Code Here

        return "multipleObsGroupDifferentAnswerConceptIdForm";
      }

      @Override
      public Encounter getEncounterToView() throws Exception {
        Encounter e = new Encounter();
        e.setPatient(getPatient());
        Date date = Context.getDateFormat().parse("01/02/2003");
        e.setDateCreated(new Date());
        e.setEncounterDatetime(date);
        e.setLocation(Context.getLocationService().getLocation(2));
        e.setProvider(Context.getPersonService().getPerson(502));

        // create three obsgroups with the identical structures but with different answer values for the obs
        TestUtil.addObsGroup(e, 7, new Date(), 1000, Context.getConceptService().getConcept(1003), new Date(), 8, "foo3",
            new Date());
        TestUtil.addObsGroup(e, 7, new Date(), 1000, Context.getConceptService().getConcept(1002), new Date(), 8, "foo2",
View Full Code Here

        return "multipleObsGroupDifferentAnswerConceptIdForm";
      }

      @Override
      public Encounter getEncounterToView() throws Exception {
        Encounter e = new Encounter();
        e.setPatient(getPatient());
        Date date = Context.getDateFormat().parse("01/02/2003");
        e.setDateCreated(new Date());
        e.setEncounterDatetime(date);
        e.setLocation(Context.getLocationService().getLocation(2));
        e.setProvider(Context.getPersonService().getPerson(502));

        // create three obsgroups with the identical structures but with different answer values for the obs
        TestUtil.addObsGroup(e, 7, new Date(), 1000, null, new Date(), 8, "foo1",
            new Date());
        TestUtil.addObsGroup(e, 7, new Date(), 1000, Context.getConceptService().getConcept(1002), new Date(), 8, "foo2",
View Full Code Here

TOP

Related Classes of org.openmrs.Encounter

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.