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

fixed bug preventing storing patient data

parent bd4c4042
......@@ -56,7 +56,18 @@ public class PatientImpl extends StoredExtensionType implements Patient {
@Override
public void setBirthDate(DateTimeAccuracy dateTime){
// TODO compare and markDirty if different (also in other setters)
if( this.birthDate == null && dateTime == null ){
// nothing to do
return;
}else if( birthDate != null && dateTime != null ){
// compare
if( birthDate.equals(dateTime) ){
// nothing to do
return;
}
}
this.birthDate = dateTime;
markDirty(true);
}
@Override
......@@ -76,7 +87,13 @@ public class PatientImpl extends StoredExtensionType implements Patient {
@Override
public void setSex(Sex sex) {
if( this.sex == null && sex == null ){
return; // nothing to do
}else if( this.sex != null && sex != null && this.sex.equals(sex) ){
return; // nothing to do
}
this.sex = sex;
markDirty(true);
}
@Override
......
......@@ -141,6 +141,9 @@ public class GroupedXMLReader implements ObservationSupplier {
if( patientData.containsKey("given-name") ){
currentPatient.setGivenName(patientData.get("given-name"));
}
if( es != null ){
currentPatient.setSourceTimestamp(es.getSourceTimestamp());
}
}
......
......@@ -721,7 +721,7 @@ public class PostgresPatientStore extends PostgresExtension<I2b2Patient> impleme
updateException(patient, e);
}
}
if( count != 0 )log.info("Updated "+count+" patients in database");
log.info("Updated "+count+" patients in database");
}
@Override
......
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