diff --git a/core/src/main/java/org/phoenixctms/ctsms/adapt/ProbandListStatusEntryCollisionFinder.java b/core/src/main/java/org/phoenixctms/ctsms/adapt/ProbandListStatusEntryCollisionFinder.java index 97508c9753da..65ddfd8c4738 100644 --- a/core/src/main/java/org/phoenixctms/ctsms/adapt/ProbandListStatusEntryCollisionFinder.java +++ b/core/src/main/java/org/phoenixctms/ctsms/adapt/ProbandListStatusEntryCollisionFinder.java @@ -52,7 +52,7 @@ protected Collection getCollidingItems( } else { probandId = root.getId(); } - return probandListStatusEntryDao.findByTrialProband(null, probandId, true, null); + return probandListStatusEntryDao.findByTrialProband(null, probandId, true, null, null); } @Override diff --git a/core/src/main/java/org/phoenixctms/ctsms/domain/ProbandListStatusEntryDaoImpl.java b/core/src/main/java/org/phoenixctms/ctsms/domain/ProbandListStatusEntryDaoImpl.java index f38d798c9bf6..a278133ed391 100644 --- a/core/src/main/java/org/phoenixctms/ctsms/domain/ProbandListStatusEntryDaoImpl.java +++ b/core/src/main/java/org/phoenixctms/ctsms/domain/ProbandListStatusEntryDaoImpl.java @@ -100,7 +100,7 @@ protected Collection handleFindByListEntry( @Override protected Collection handleFindByTrialProband( - Long trialId, Long probandId, boolean last, PSFVO psf) + Long trialId, Long probandId, boolean last, Boolean initial, PSFVO psf) throws Exception { org.hibernate.Criteria statusEntryCriteria = createStatusEntryCriteria("probandListStatusEntry"); SubCriteriaMap criteriaMap = new SubCriteriaMap(ProbandListStatusEntry.class, statusEntryCriteria); @@ -110,6 +110,9 @@ protected Collection handleFindByTrialProband( if (probandId != null) { criteriaMap.createCriteria("listEntry").add(Restrictions.eq("proband.id", probandId.longValue())); } + if (initial != null) { + criteriaMap.createCriteria("status").add(Restrictions.eq("initial", initial.booleanValue())); + } if (last) { criteriaMap.createCriteria("listEntry.lastStatus").add(Restrictions.eqProperty("id", "probandListStatusEntry.id")); // didn't work without explicit id compare } diff --git a/core/src/main/java/org/phoenixctms/ctsms/service/trial/TrialServiceImpl.java b/core/src/main/java/org/phoenixctms/ctsms/service/trial/TrialServiceImpl.java index d00de074d9c1..2dc889dffd77 100644 --- a/core/src/main/java/org/phoenixctms/ctsms/service/trial/TrialServiceImpl.java +++ b/core/src/main/java/org/phoenixctms/ctsms/service/trial/TrialServiceImpl.java @@ -6695,7 +6695,7 @@ protected ProbandListEntryTagValuesOutVO handleGetProbandListEntryTagValues( @Override protected Collection handleGetProbandListStatus( - AuthenticationVO auth, Long trialId, Long probandId, boolean last, PSFVO psf) + AuthenticationVO auth, Long trialId, Long probandId, boolean last, Boolean initial, PSFVO psf) throws Exception { if (trialId != null) { CheckIDUtil.checkTrialId(trialId, this.getTrialDao()); @@ -6704,7 +6704,7 @@ protected Collection handleGetProbandListStatus( CheckIDUtil.checkProbandId(probandId, this.getProbandDao()); } ProbandListStatusEntryDao probandListStatusEntryDao = this.getProbandListStatusEntryDao(); - Collection statusEntries = probandListStatusEntryDao.findByTrialProband(trialId, probandId, last, psf); + Collection statusEntries = probandListStatusEntryDao.findByTrialProband(trialId, probandId, last, initial, psf); probandListStatusEntryDao.toProbandListStatusEntryOutVOCollection(statusEntries); return statusEntries; }