Ejemplo n.º 1
0
  private void deletePatient(OpenMRSPatient patient)
      throws PatientNotFoundException, InterruptedException {

    String facilityId = patient.getFacility().getFacilityId();

    patientAdapter.deletePatient(patient.getPatientId());
    assertNull(patientAdapter.getPatientByUuid(patient.getPatientId()));

    facilityAdapter.deleteFacility(facilityId);
  }
Ejemplo n.º 2
0
  @After
  public void tearDown() throws InterruptedException, PatientNotFoundException {

    String uuid = patient.getFacility().getFacilityId();

    deletePatient(patient);

    if (uuid != null) {
      facilityAdapter.deleteFacility(uuid);
    }

    conceptAdapter.deleteConcept(causeOfDeath.getUuid());

    eventListenerRegistry.clearListenersForBean("mrsTestListener");
  }
Ejemplo n.º 3
0
  private OpenMRSPatient preparePatient() {

    OpenMRSPerson person = new OpenMRSPerson();
    person.setFirstName("John");
    person.setLastName("Smith");
    person.setAddress("10 Fifth Avenue");
    person.setBirthDateEstimated(false);
    person.setGender("M");

    OpenMRSAttribute attr = new OpenMRSAttribute("Birthplace", "Motech");
    List<OpenMRSAttribute> attributes = new ArrayList<>();
    attributes.add(attr);
    person.setAttributes(attributes);
    OpenMRSFacility facility =
        facilityAdapter.createFacility(
            new OpenMRSFacility(
                "FooName", "FooCountry", "FooRegion", "FooCountryDistrict", "FooStateProvince"));

    assertNotNull(facility);

    OpenMRSPatient patient = new OpenMRSPatient("602", person, facility);

    return patient;
  }