Package org.openmrs

Examples of org.openmrs.Patient


 
  @Test
  @Verifies(value = "should return null if no program enrollment after specified date", method = "getClosestFutureProgramEnrollment(Patient,Program,Date)")
  public void getClosestFutureProgramEnrollment_shouldReturnNullIfNoProgramEnrollmentAfterSpecifiedDate() throws Exception {
    ProgramWorkflowService pws = Context.getProgramWorkflowService();
    Patient patient = Context.getPatientService().getPatient(2);
    Program program = pws.getProgram(1);
    Assert.assertNull(HtmlFormEntryUtil.getClosestFutureProgramEnrollment(patient, program, new Date()));
  }
View Full Code Here


  public void shouldReturnPatientProgramWithEnrollmentAfterSpecifiedDate() throws Exception {
    // load this data set so that we get the additional patient program created in this data case
    executeDataSet(XML_DATASET_PATH + new TestUtil().getTestDatasetFilename(XML_REGRESSION_TEST_DATASET));
   
    ProgramWorkflowService pws = Context.getProgramWorkflowService();
    Patient patient = Context.getPatientService().getPatient(2);
    Program program = pws.getProgram(1);
   
    Calendar cal = Calendar.getInstance();
    cal.set(2001, 6, 31);
    Date date = cal.getTime();
View Full Code Here

 
  @Test
  @Verifies(value = "should return null if program enrollment date same as specified date", method = "getClosestFutureProgramEnrollment(Patient,Program,Date)")
  public void getClosestFutureProgramEnrollment_shouldReturnNullIfProgramEnrollmentSameAsSpecifiedDate() throws Exception {
    ProgramWorkflowService pws = Context.getProgramWorkflowService();
    Patient patient = Context.getPatientService().getPatient(2);
    Program program = pws.getProgram(1);
    Date date = pws.getPatientProgram(1).getDateEnrolled();
    Assert.assertNull(HtmlFormEntryUtil.getClosestFutureProgramEnrollment(patient, program, date));
  }
View Full Code Here

      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());
      raxaAlert.setPatient(patient);
    }
    if (post.get("name") != null) {
      raxaAlert.setName(post.get("name").toString());
    }
View Full Code Here

    String json = "{\"names\": [{\"givenName\":\"john\",\"familyName\":\"James\"}],\"gender\":\"M\", \"age\":23 }";
    SimpleObject post = new ObjectMapper().readValue(json, SimpleObject.class);
    SimpleObject patient = (SimpleObject) (controller.createNewPatient(post, request, response));
    System.out.println(patient);
    System.out.println(patient.get("uuid"));
    Patient p = Context.getPatientService().getPatientByUuid(patient.get("uuid").toString());
    Assert.assertNotNull(p);
    Assert.assertEquals("James", p.getFamilyName());
    Assert.assertTrue(p.getAge() == 23);
  }
View Full Code Here

    //"?encounterType=<uuid>&startDate=2012-05-07&endDate=2012-05-08&inlist=<uuidForList>&notinlist=<uuidForList>"
    EncounterType encType = null;
    Date startDate = null;
    Date endDate = null;
    Provider provid = null;
    Patient patient = null;
    String uuid = null;
    //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>();
View Full Code Here

      }
    }
    PatientIdentifier pi = new PatientIdentifier(identifier, service
            .getPatientIdentifierTypeByName("RaxaEMR Identifier Number"), location);
    pi.setPreferred(true);
    Patient patient = new Patient(person);
    patient.addIdentifier(pi);
    return service.savePatient(patient);
  }
View Full Code Here

      }
    }
    PatientIdentifier pi = new PatientIdentifier(identifier, Context.getPatientService().getPatientIdentifierTypeByName(
        "RaxaEMR Identifier Number"), location);
    pi.setPreferred(true);
    Patient patient = new Patient(person);
    patient.addIdentifier(pi);
    System.out.println(patient.getPatientIdentifier());
    int personId = Context.getPatientService().savePatient(patient).getPersonId();
    return (Context.getPersonService().getPerson(personId));
  }
View Full Code Here

TOP

Related Classes of org.openmrs.Patient

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.