use of com.hartwig.hmftools.common.ecrf.datamodel.EcrfItemGroup in project hmftools by hartwigmedical.
the class CpctPatientReader method setDeathData.
private static void setDeathData(@NotNull final ImmutableBaselineData.Builder builder, @NotNull final EcrfPatient patient) {
for (final EcrfStudyEvent endStudyEvent : patient.studyEventsPerOID(STUDY_ENDSTUDY)) {
for (final EcrfForm deathForm : endStudyEvent.nonEmptyFormsPerOID(FORM_DEATH, false)) {
for (final EcrfItemGroup deathItemGroup : deathForm.nonEmptyItemGroupsPerOID(ITEMGROUP_DEATH, false)) {
builder.deathDate(deathItemGroup.readItemDate(FIELD_DEATH_DATE, 0, DATE_FORMATTER, false));
builder.deathStatus(deathForm.status());
builder.deathLocked(deathForm.locked());
}
}
}
}
use of com.hartwig.hmftools.common.ecrf.datamodel.EcrfItemGroup in project hmftools by hartwigmedical.
the class PreTreatmentReader method readDrugs.
@NotNull
private List<DrugData> readDrugs(@NotNull final EcrfForm treatmentForm) throws IOException {
final List<DrugData> drugs = Lists.newArrayList();
for (final EcrfItemGroup itemGroup : treatmentForm.nonEmptyItemGroupsPerOID(ITEMGROUP_DRUGS, false)) {
final LocalDate drugStart = itemGroup.readItemDate(FIELD_PRE_DRUG_START, 0, DATE_FORMATTER, false);
final LocalDate drugEnd = itemGroup.readItemDate(FIELD_PRE_DRUG_END, 0, DATE_FORMATTER, false);
final String drugName = itemGroup.readItemString(FIELD_PRE_DRUG, 0, false);
final String bestResponse = itemGroup.readItemString(FIELD_PRE_BEST_RESPONSE, 0, false);
final List<CuratedTreatment> curatedDrugs = drugName == null ? Lists.newArrayList() : treatmentCurator.search(drugName);
drugs.add(ImmutableDrugData.of(drugName, drugStart, drugEnd, bestResponse, curatedDrugs));
}
return drugs;
}
use of com.hartwig.hmftools.common.ecrf.datamodel.EcrfItemGroup 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.common.ecrf.datamodel.EcrfItemGroup in project hmftools by hartwigmedical.
the class CpctPatientReader method setInformedConsent.
private void setInformedConsent(@NotNull final ImmutableBaselineData.Builder builder, @NotNull final EcrfStudyEvent studyEvent) {
for (final EcrfForm informedConsentForm : studyEvent.nonEmptyFormsPerOID(FORM_INFORMED_CONSENT, false)) {
for (final EcrfItemGroup informedConsentItemGroup : informedConsentForm.nonEmptyItemGroupsPerOID(ITEMGROUP_INFORMED_CONSENT, false)) {
builder.informedConsentDate(informedConsentItemGroup.readItemDate(FIELD_INFORMED_CONSENT_DATE, 0, DATE_FORMATTER, false));
builder.informedConsentStatus(informedConsentForm.status());
builder.informedConsentLocked(informedConsentForm.locked());
}
}
}
use of com.hartwig.hmftools.common.ecrf.datamodel.EcrfItemGroup in project hmftools by hartwigmedical.
the class CpctPatientReader method setPrimaryTumorData.
private void setPrimaryTumorData(@NotNull final ImmutableBaselineData.Builder builder, @NotNull final EcrfStudyEvent studyEvent) {
for (final EcrfForm carcinomaForm : studyEvent.nonEmptyFormsPerOID(FORM_CARCINOMA, false)) {
for (final EcrfItemGroup carcinomaItemGroup : carcinomaForm.nonEmptyItemGroupsPerOID(ITEMGROUP_CARCINOMA, false)) {
String primaryTumorLocation = carcinomaItemGroup.readItemString(FIELD_PRIMARY_TUMOR_LOCATION, 0, false);
if (primaryTumorLocation != null && primaryTumorLocation.trim().toLowerCase().startsWith("other")) {
primaryTumorLocation = carcinomaItemGroup.readItemString(FIELD_PRIMARY_TUMOR_LOCATION_OTHER, 0, false);
}
builder.cancerType(tumorLocationCurator.search(primaryTumorLocation));
builder.primaryTumorStatus(carcinomaForm.status());
builder.primaryTumorLocked(carcinomaForm.locked());
}
}
}
Aggregations