Commit e7fb28c8 authored by R.W.Majeed's avatar R.W.Majeed

fixed import module for previous change in visit.setPatient

parent eb135839
......@@ -37,17 +37,24 @@ public class VisitImpl extends StoredExtensionType implements Visit {
private String patientId;
private String locationId;
public VisitImpl(){
/**
* Empty constructor protected, only
* available to overriding classes.
*/
protected VisitImpl() {
}
public VisitImpl(String id, String patientId, DateTimeAccuracy startTime, DateTimeAccuracy endTime, Status status){
public VisitImpl(String id, String patientId, DateTimeAccuracy startTime){
setId(id);
this.patientId = patientId;
this.startTime = startTime;
markDirty(true);
}
public VisitImpl(String id, String patientId, DateTimeAccuracy startTime, DateTimeAccuracy endTime, Status status){
this(id, patientId, startTime);
this.status = status;
this.startTime = startTime;
this.endTime = endTime;
markDirty(true);
}
public String getPatientId(){return patientId;}
......@@ -59,7 +66,7 @@ public class VisitImpl extends StoredExtensionType implements Visit {
// TODO need to update dirty flag?
markDirty(true);
}
@Override
public DateTimeAccuracy getStartTime() {
return startTime;
......
......@@ -3,13 +3,15 @@ package de.sekmi.histream.etl;
import java.util.ArrayList;
import java.util.List;
import de.sekmi.histream.DateTimeAccuracy;
import de.sekmi.histream.Observation;
import de.sekmi.histream.impl.VisitImpl;
public class VisitRow extends VisitImpl implements FactRow{
List<Observation> facts;
public VisitRow(){
public VisitRow(String visitId, String patientId, DateTimeAccuracy startTime){
super(visitId, patientId, startTime);
facts = new ArrayList<>();
}
@Override
......@@ -21,6 +23,4 @@ public class VisitRow extends VisitImpl implements FactRow{
public String getVisitId() {
return this.getId();
}
}
......@@ -84,19 +84,18 @@ public class VisitTable extends Table<VisitRow> implements ConceptTable{
@Override
public VisitRow fillRecord(ColumnMap map, Object[] row, ObservationFactory factory) throws ParseException {
VisitRow visit = new VisitRow();
visit.setId(idat.visitId.valueOf(map, row));
visit.setPatientId(idat.patientId.valueOf(map, row));
String vid = idat.visitId.valueOf(map, row);
String pid = idat.patientId.valueOf(map, row);
DateTimeAccuracy start = idat.start.valueOf(map, row);
if( start != null ){
visit.setStartTime(start);
}else{
if( start == null ){
// no start time specified for visit row
// any other way to retrieve a timestamp??
// ignore row
// TODO issue warning
return null;
}
VisitRow visit = new VisitRow(vid, pid, start);
if( idat.end != null ){
visit.setEndTime(idat.end.valueOf(map, row));
}
......
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