@Test public void testGetPatientsDemographicsNoBirthDate() { expectedException.expect(SystemException.class); expectedException.expectMessage("No Patient.birthDate defined"); final Bundle result = new Bundle(); final Bundle.Entry entry1 = getPatientResultBundleEntry( "patient1", "Patient Name1", null, AdministrativeGenderEnum.FEMALE); result.addEntry(entry1); mockFhirClientResult(result); patientDemographicsProvider.getPatientsDemographics(Lists.newArrayList("patient1")); }
@Override public List<PatientDemographicsDto> getPatientsDemographics(@Nonnull final Collection<String> patientsIds) { Preconditions.checkNotNull(patientsIds, "patientsIds must not be null"); if (patientsIds.isEmpty()) { return Collections.emptyList(); } final List<Patient> patients = queryPatients(patientsIds); return patients.stream() .map(this::getPatientDemographicsDto) .collect(Collectors.toList()); }
FhirPatientDemographicsProvider implements PatientDemographicsProvider { @Override public List<PatientDemographicsDto> getPatientsDemographics(@Nonnull final Collection<String> patientsIds) { Preconditions.checkNotNull(patientsIds, "patientsIds must not be null"); if (patientsIds.isEmpty()) { return Collections.emptyList(); } final List<Patient> patients = queryPatients(patientsIds); return patients.stream() .map(this::getPatientDemographicsDto) .collect(Collectors.toList()); } }
FhirPatientDemographicsProvider implements PatientDemographicsProvider { @Override public List<PatientDemographicsDto> getPatientsDemographics(@Nonnull final Collection<String> patientsIds) { Preconditions.checkNotNull(patientsIds, "patientsIds must not be null"); if (patientsIds.isEmpty()) { return Collections.emptyList(); } final List<Patient> patients = queryPatients(patientsIds); return patients.stream() .map(this::getPatientDemographicsDto) .collect(Collectors.toList()); }  }
FhirPatientDemographicsProvider implements PatientDemographicsProvider { @Override public List<PatientDemographicsDto> getPatientsDemographics(@Nonnull final Collection<String> patientsIds) { Preconditions.checkNotNull(patientsIds, "patientsIds must not be null"); if (patientsIds.isEmpty()) { return Collections.emptyList(); } final List<Patient> patients = queryPatients(patientsIds); return patients.stream() .map(this::getPatientDemographicsDto) .collect(Collectors.toList()); }  @Required void setFhirClient(final IGenericClient fhirClient); @Required void setFhirPatientIdSystem(final String fhirPatientIdSystem); @Override List<PatientDemographicsDto> getPatientsDemographics(@Nonnull final Collection<String> patientsIds); }
FhirPatientDemographicsProvider implements PatientDemographicsProvider { @Override public List<PatientDemographicsDto> getPatientsDemographics(@Nonnull final Collection<String> patientsIds) { Preconditions.checkNotNull(patientsIds, "patientsIds must not be null"); if (patientsIds.isEmpty()) { return Collections.emptyList(); } final List<Patient> patients = queryPatients(patientsIds); return patients.stream() .map(this::getPatientDemographicsDto) .collect(Collectors.toList()); }  @Required void setFhirClient(final IGenericClient fhirClient); @Required void setFhirPatientIdSystem(final String fhirPatientIdSystem); @Override List<PatientDemographicsDto> getPatientsDemographics(@Nonnull final Collection<String> patientsIds);  }