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;
}
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;
}
Aggregations