WidePatientReader { @NotNull public Patient read(@NotNull String patientIdentifier, @Nullable String limsPrimaryTumorLocation, @NotNull List<SampleData> sequencedSamples) { BaselineData baseline = buildBaselineData(patientIdentifier, limsPrimaryTumorLocation); MatchResult<BiopsyData> matchedBiopsies = buildMatchedBiopsies(patientIdentifier, sequencedSamples); List<BiopsyTreatmentData> treatments = buildBiopsyTreatmentData(patientIdentifier); List<BiopsyTreatmentResponseData> responses = buildBiopsyTreatmentResponseData(patientIdentifier); return new Patient(patientIdentifier, baseline, ImmutablePreTreatmentData.builder().formStatus(FormStatus.undefined()).build(), sequencedSamples, matchedBiopsies.values(), treatments, responses, Lists.newArrayList(), Lists.newArrayList(), matchedBiopsies.findings()); } WidePatientReader(@NotNull final WideEcrfModel wideEcrfModel, @NotNull final TumorLocationCurator tumorLocationCurator,
            @NotNull final TreatmentCurator treatmentCurator); @NotNull Patient read(@NotNull String patientIdentifier, @Nullable String limsPrimaryTumorLocation,
            @NotNull List<SampleData> sequencedSamples); @NotNull static List<DrugData> preAvlTreatmentDrugList(@NotNull WidePreAvlTreatmentData preAvlTreatment,
            @NotNull TreatmentCurator treatmentCurator);  }
@Test public void canLoadEmptyPatient() { WideEcrfModel wideEcrfModel = ImmutableWideEcrfModel.builder() .preAvlTreatments(Lists.newArrayList()) .biopsies(Lists.newArrayList()) .avlTreatments(Lists.newArrayList()) .responses(Lists.newArrayList()) .build(); WidePatientReader patientReader = new WidePatientReader(wideEcrfModel, TestCuratorFactory.tumorLocationCurator(), TestCuratorFactory.treatmentCurator()); SampleData sample = sampleBuilder(LocalDate.parse("2017-01-01")).build(); Patient patient = patientReader.read("ID", "Melanoma", Lists.newArrayList(sample)); assertNotNull(patient); }