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; package de.sekmi.histream.etl;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import de.sekmi.histream.Observation; import de.sekmi.histream.Observation;
...@@ -16,18 +17,19 @@ public class PatientRow extends PatientImpl implements FactRow{ ...@@ -16,18 +17,19 @@ public class PatientRow extends PatientImpl implements FactRow{
String firstname; String firstname;
String lastname; String lastname;
// TODO concepts // TODO concepts
List<Observation> facts;
public void setNames(String first, String last){ public void setNames(String first, String last){
this.firstname = first; this.firstname = first;
this.lastname = last; this.lastname = last;
this.facts = new ArrayList<>();
} }
@Override @Override
public List<Observation> getFacts() { public List<Observation> getFacts() {
// TODO Auto-generated method stub return facts;
return null;
} }
......
package de.sekmi.histream.etl; package de.sekmi.histream.etl;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import de.sekmi.histream.Observation; import de.sekmi.histream.Observation;
import de.sekmi.histream.impl.VisitImpl; import de.sekmi.histream.impl.VisitImpl;
public class VisitRow extends VisitImpl implements FactRow{ public class VisitRow extends VisitImpl implements FactRow{
List<Observation> facts;
public VisitRow(){
facts = new ArrayList<>();
}
@Override @Override
public List<Observation> getFacts() { public List<Observation> getFacts() {
// TODO Auto-generated method stub return facts;
return null;
} }
@Override @Override
......
...@@ -6,6 +6,7 @@ import javax.xml.bind.annotation.XmlAccessorType; ...@@ -6,6 +6,7 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlElementWrapper;
import de.sekmi.histream.Observation;
import de.sekmi.histream.ObservationFactory; import de.sekmi.histream.ObservationFactory;
import de.sekmi.histream.etl.ColumnMap; import de.sekmi.histream.etl.ColumnMap;
import de.sekmi.histream.etl.ConceptTable; import de.sekmi.histream.etl.ConceptTable;
...@@ -58,7 +59,13 @@ public class PatientTable extends Table<PatientRow> implements 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.setNames(idat.firstname.valueOf(map, row), idat.surname.valueOf(map, row));
patient.setBirthDate(idat.birthdate.valueOf(map, row)); patient.setBirthDate(idat.birthdate.valueOf(map, row));
patient.setDeathDate(idat.deathdate.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; return patient;
} }
......
...@@ -6,6 +6,7 @@ import javax.xml.bind.annotation.XmlElement; ...@@ -6,6 +6,7 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlType;
import de.sekmi.histream.Observation;
import de.sekmi.histream.ObservationFactory; import de.sekmi.histream.ObservationFactory;
import de.sekmi.histream.etl.ColumnMap; import de.sekmi.histream.etl.ColumnMap;
import de.sekmi.histream.etl.ConceptTable; import de.sekmi.histream.etl.ConceptTable;
...@@ -53,7 +54,14 @@ public class VisitTable extends Table<VisitRow> implements ConceptTable{ ...@@ -53,7 +54,14 @@ public class VisitTable extends Table<VisitRow> implements ConceptTable{
visit.setStartTime(idat.start.valueOf(map, row)); visit.setStartTime(idat.start.valueOf(map, row));
visit.setEndTime(idat.end.valueOf(map, row)); visit.setEndTime(idat.end.valueOf(map, row));
// TODO other // 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; return visit;
} }
......
Supports Markdown
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