Lims { @Nullable public LocalDate arrivalDate(@NotNull String sampleBarcode, @NotNull String fallbackSampleId) { LimsJsonSampleData sampleData = dataPerSampleBarcode.get(sampleBarcode); LocalDate arrivalDate = sampleData != null ? getNullableDate(sampleData.arrivalDate()) : null; if (arrivalDate == null) { arrivalDate = preLimsArrivalDatesPerSampleId.get(fallbackSampleId); } return arrivalDate; } Lims(@NotNull final Map<String, LimsJsonSampleData> dataPerSampleBarcode,
            @NotNull final Map<String, LimsJsonSubmissionData> dataPerSubmission,
            @NotNull final Map<String, LimsShallowSeqData> shallowSeqPerSampleBarcode,
            @NotNull final Map<String, LocalDate> preLimsArrivalDatesPerSampleId, @NotNull final Set<String> samplesIdsWithoutSamplingDate,
            @NotNull final Set<String> blacklistedPatients, @NotNull final HospitalModel hospitalModel); int sampleBarcodeCount(); @NotNull Set<String> sampleBarcodes(); void validateSampleBarcodeCombination(@NotNull String refBarcode, @NotNull String refSampleId, @NotNull String tumorBarcode,
            @NotNull String tumorSampleId); @NotNull String patientId(@NotNull String sampleBarcode); @NotNull String sampleId(@NotNull String sampleBarcode); @Nullable LocalDate arrivalDate(@NotNull String sampleBarcode, @NotNull String fallbackSampleId); @Nullable LocalDate samplingDate(@NotNull String sampleBarcode); boolean confirmedToHaveNoSamplingDate(@NotNull String sampleId); boolean isBlacklisted(@NotNull String patientId); @NotNull String submissionId(@NotNull String sampleBarcode); @NotNull String projectName(@NotNull String sampleBarcode); @NotNull String requesterName(@NotNull String sampleBarcode); @NotNull String requesterEmail(@NotNull String sampleBarcode); @Nullable Integer dnaNanograms(@NotNull String sampleBarcode); @NotNull String purityShallowSeq(@NotNull String sampleBarcode); @NotNull String pathologyTumorPercentage(@NotNull String sampleBarcode); @NotNull String primaryTumor(@NotNull String sampleBarcode); @NotNull String labProcedures(@NotNull String sampleBarcode); @NotNull String cohort(@NotNull String sampleBarcode); @NotNull HospitalContactData hospitalContactData(@NotNull String sampleBarcode); @NotNull String hospitalPatientId(@NotNull String sampleBarcode); @NotNull String hospitalPathologySampleId(@NotNull String sampleBarcode); @NotNull LimsGermlineReportingLevel germlineReportingChoice(@NotNull String sampleBarcode); boolean reportGermlineVariants(@NotNull String sampleBarcode); boolean reportViralInsertions(@NotNull String sampleBarcode); static final String NOT_AVAILABLE_STRING; static final String NOT_PERFORMED_STRING; static final String PURITY_NOT_RELIABLE_STRING; }
@Test public void fallBackOnPreLimsArrivalDateWorks() { LocalDate date = LimsTestUtil.toDate("2017-10-03"); Lims lims = buildTestLimsWithPreLimsArrivalDateForSampleId(TUMOR_SAMPLE_ID, date); assertEquals(date, lims.arrivalDate("DoesNotExist", TUMOR_SAMPLE_ID)); }