Search in sources :

Example 1 with CuratedTreatment

use of com.hartwig.hmftools.patientdb.data.CuratedTreatment in project hmftools by hartwigmedical.

the class BiopsyTreatmentReader 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_SYSPOSTBIO, false)) {
        final LocalDate drugStart = itemGroup.readItemDate(FIELD_DRUG_START, 0, DATE_FORMATTER, false);
        final LocalDate drugEnd = itemGroup.readItemDate(FIELD_DRUG_END, 0, DATE_FORMATTER, false);
        String drugName = itemGroup.readItemString(FIELD_DRUG, 0, false);
        if (drugName == null || drugName.trim().toLowerCase().startsWith("other")) {
            drugName = itemGroup.readItemString(FIELD_DRUG_OTHER, 0, false);
        }
        final List<CuratedTreatment> curatedDrugs = drugName == null ? Lists.newArrayList() : treatmentCurator.search(drugName);
        drugs.add(ImmutableDrugData.of(drugName, drugStart, drugEnd, null, curatedDrugs));
    }
    return drugs;
}
Also used : DrugData(com.hartwig.hmftools.patientdb.data.DrugData) ImmutableDrugData(com.hartwig.hmftools.patientdb.data.ImmutableDrugData) CuratedTreatment(com.hartwig.hmftools.patientdb.data.CuratedTreatment) EcrfItemGroup(com.hartwig.hmftools.common.ecrf.datamodel.EcrfItemGroup) LocalDate(java.time.LocalDate) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with CuratedTreatment

use of com.hartwig.hmftools.patientdb.data.CuratedTreatment 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;
}
Also used : DrugData(com.hartwig.hmftools.patientdb.data.DrugData) ImmutableDrugData(com.hartwig.hmftools.patientdb.data.ImmutableDrugData) CuratedTreatment(com.hartwig.hmftools.patientdb.data.CuratedTreatment) EcrfItemGroup(com.hartwig.hmftools.common.ecrf.datamodel.EcrfItemGroup) LocalDate(java.time.LocalDate) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

EcrfItemGroup (com.hartwig.hmftools.common.ecrf.datamodel.EcrfItemGroup)2 CuratedTreatment (com.hartwig.hmftools.patientdb.data.CuratedTreatment)2 DrugData (com.hartwig.hmftools.patientdb.data.DrugData)2 ImmutableDrugData (com.hartwig.hmftools.patientdb.data.ImmutableDrugData)2 LocalDate (java.time.LocalDate)2 NotNull (org.jetbrains.annotations.NotNull)2