use of com.hartwig.hmftools.patientdb.data.TumorMarkerData in project hmftools by hartwigmedical.
the class PatientReader method read.
@NotNull
public Patient read(@NotNull final EcrfPatient ecrfPatient, @NotNull final List<SampleData> sequencedSamples) throws IOException {
LOGGER.info("Reading patient " + ecrfPatient.patientId() + " with samples: " + sequencedSamples);
final BaselineData baselineData = cpctPatientReader.read(ecrfPatient);
final PreTreatmentData preTreatmentData = preTreatmentReader.read(ecrfPatient);
final List<BiopsyData> clinicalBiopsies = BiopsyReader.read(ecrfPatient);
final List<BiopsyTreatmentData> treatments = biopsyTreatmentReader.read(ecrfPatient);
final List<BiopsyTreatmentResponseData> treatmentResponses = BiopsyTreatmentResponseReader.read(ecrfPatient);
final List<TumorMarkerData> tumorMarkers = TumorMarkerReader.read(ecrfPatient);
final MatchResult<BiopsyData> matchedBiopsies = BiopsyMatcher.matchBiopsiesToTumorSamples(ecrfPatient.patientId(), sequencedSamples, clinicalBiopsies);
final MatchResult<BiopsyTreatmentData> matchedTreatments = TreatmentMatcher.matchTreatmentsToBiopsies(ecrfPatient.patientId(), clinicalBiopsies, treatments);
final MatchResult<BiopsyTreatmentResponseData> matchedResponses = TreatmentResponseMatcher.matchTreatmentResponsesToTreatments(ecrfPatient.patientId(), treatments, treatmentResponses);
final List<ValidationFinding> findings = Lists.newArrayList();
findings.addAll(matchedBiopsies.findings());
findings.addAll(matchedTreatments.findings());
findings.addAll(matchedResponses.findings());
return new Patient(ecrfPatient.patientId(), baselineData, preTreatmentData, sequencedSamples, matchedBiopsies.values(), matchedTreatments.values(), matchedResponses.values(), tumorMarkers, findings);
}
use of com.hartwig.hmftools.patientdb.data.TumorMarkerData in project hmftools by hartwigmedical.
the class TumorMarkerReader method read.
@NotNull
static List<TumorMarkerData> read(@NotNull final EcrfPatient patient) {
final List<TumorMarkerData> tumorMarkers = Lists.newArrayList();
for (final EcrfStudyEvent studyEvent : patient.studyEventsPerOID(STUDY_TREATMENT)) {
for (final EcrfForm form : studyEvent.nonEmptyFormsPerOID(FORM_RESPONSE, false)) {
for (final EcrfItemGroup responseGroup : form.nonEmptyItemGroupsPerOID(ITEMGROUP_RESPONSE, false)) {
LocalDate date = responseGroup.readItemDate(FIELD_DATE, 0, DATE_FORMATTER, false);
String marker = responseGroup.readItemString(FIELD_MARKER, 0, false);
String measurement = responseGroup.readItemString(FIELD_MEASUREMENT, 0, false);
String unit = responseGroup.readItemString(FIELD_UNIT, 0, false);
tumorMarkers.add(ImmutableTumorMarkerData.of(patient.patientId(), date, marker, measurement, unit, form.status(), form.locked()));
}
}
}
return tumorMarkers;
}
use of com.hartwig.hmftools.patientdb.data.TumorMarkerData in project hmftools by hartwigmedical.
the class PatientReaderTest method canReadTumorMarkers.
@Test
public void canReadTumorMarkers() {
final CpctEcrfModel model = loadTestEcrf();
assertEquals(1, model.patientCount());
final EcrfPatient cpctPatient = model.patients().iterator().next();
final List<TumorMarkerData> tumorMarkers = TumorMarkerReader.read(cpctPatient);
assertEquals(0, tumorMarkers.size());
}
Aggregations