Commit e5be0fb5 authored by R.W.Majeed's avatar R.W.Majeed
Browse files

concepts are loaded for patient+visit tables

parent 4abdb076
package de.sekmi.histream.etl;
import java.util.ArrayList;
import java.util.List;
import de.sekmi.histream.Observation;
......@@ -16,18 +17,19 @@ public class PatientRow extends PatientImpl implements FactRow{
String firstname;
String lastname;
// TODO concepts
List<Observation> facts;
public void setNames(String first, String last){
this.firstname = first;
this.lastname = last;
this.facts = new ArrayList<>();
}
@Override
public List<Observation> getFacts() {
// TODO Auto-generated method stub
return null;
return facts;
}
......
package de.sekmi.histream.etl;
import java.util.ArrayList;
import java.util.List;
import de.sekmi.histream.Observation;
import de.sekmi.histream.impl.VisitImpl;
public class VisitRow extends VisitImpl implements FactRow{
List<Observation> facts;
public VisitRow(){
facts = new ArrayList<>();
}
@Override
public List<Observation> getFacts() {
// TODO Auto-generated method stub
return null;
return facts;
}
@Override
......
......@@ -6,6 +6,7 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import de.sekmi.histream.Observation;
import de.sekmi.histream.ObservationFactory;
import de.sekmi.histream.etl.ColumnMap;
import de.sekmi.histream.etl.ConceptTable;
......@@ -58,7 +59,13 @@ public class PatientTable extends Table<PatientRow> implements ConceptTable{
patient.setNames(idat.firstname.valueOf(map, row), idat.surname.valueOf(map, row));
patient.setBirthDate(idat.birthdate.valueOf(map, row));
patient.setDeathDate(idat.deathdate.valueOf(map, row));
// TODO concepts
// concepts
if( concepts != null ){
for( Concept c : concepts ){
Observation o = c.createObservation(patient.getPatientId(), null, factory, map, row);
patient.getFacts().add(o);
}
}
return patient;
}
......
......@@ -6,6 +6,7 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlType;
import de.sekmi.histream.Observation;
import de.sekmi.histream.ObservationFactory;
import de.sekmi.histream.etl.ColumnMap;
import de.sekmi.histream.etl.ConceptTable;
......@@ -53,7 +54,14 @@ public class VisitTable extends Table<VisitRow> implements ConceptTable{
visit.setStartTime(idat.start.valueOf(map, row));
visit.setEndTime(idat.end.valueOf(map, row));
// TODO other
// TODO concepts
// concepts
if( concepts != null ){
for( Concept c : concepts ){
Observation o = c.createObservation(visit.getPatientId(), visit.getId(), factory, map, row);
visit.getFacts().add(o);
}
}
return visit;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment