Search in sources :

Example 1 with XMLEcrfDatamodel

use of com.hartwig.hmftools.common.ecrf.reader.XMLEcrfDatamodel in project hmftools by hartwigmedical.

the class CpctEcrfModel method loadFromXML.

@NotNull
public static CpctEcrfModel loadFromXML(@NotNull final String ecrfXmlPath, @NotNull final FormStatusModel formStatusModel) throws XMLStreamException, FileNotFoundException {
    final XMLInputFactory factory = XMLInputFactory.newInstance();
    final XMLStreamReader reader = factory.createXMLStreamReader(new FileInputStream(ecrfXmlPath));
    final XMLEcrfDatamodel datamodel = XMLEcrfDatamodelReader.readXMLDatamodel(reader);
    final Iterable<EcrfPatient> patients = XMLPatientReader.readPatients(reader, datamodel, formStatusModel);
    return new CpctEcrfModel(datamodel, patients);
}
Also used : XMLStreamReader(javax.xml.stream.XMLStreamReader) XMLEcrfDatamodel(com.hartwig.hmftools.common.ecrf.reader.XMLEcrfDatamodel) EcrfPatient(com.hartwig.hmftools.common.ecrf.datamodel.EcrfPatient) XMLInputFactory(javax.xml.stream.XMLInputFactory) FileInputStream(java.io.FileInputStream) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

EcrfPatient (com.hartwig.hmftools.common.ecrf.datamodel.EcrfPatient)1 XMLEcrfDatamodel (com.hartwig.hmftools.common.ecrf.reader.XMLEcrfDatamodel)1 FileInputStream (java.io.FileInputStream)1 XMLInputFactory (javax.xml.stream.XMLInputFactory)1 XMLStreamReader (javax.xml.stream.XMLStreamReader)1 NotNull (org.jetbrains.annotations.NotNull)1