Skip to content

Commit

Permalink
filter ecrf issues by department - impl
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrenn committed Jun 17, 2024
1 parent 1377ebf commit dbcfc7a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -485,20 +485,22 @@ protected long handleGetCount(ECRFFieldStatusQueue queue, Long probandListEntryI
}

@Override
protected long handleGetCount(ECRFFieldStatusQueue queue, Long trialId, Long probandListEntryId, Long ecrfId, Long visitId, boolean last)
protected long handleGetCount(ECRFFieldStatusQueue queue, Long trialId, Long departmentId, Long probandListEntryId, Long ecrfId, Long visitId, boolean last)
throws Exception {
org.hibernate.Criteria ecrfFieldStatusEntryCriteria = createEcrfFieldStatusEntryCriteria("ecrfFieldStatusEntry0");
if (queue != null) {
ecrfFieldStatusEntryCriteria.add(Restrictions.eq("queue", queue));
}
org.hibernate.Criteria listEntryCriteria = ecrfFieldStatusEntryCriteria.createCriteria("listEntry", "probandListEntry0");
if (trialId != null || probandListEntryId != null) {
if (trialId != null) {
listEntryCriteria.add(Restrictions.eq("trial.id", trialId.longValue()));
}
if (probandListEntryId != null) {
listEntryCriteria.add(Restrictions.idEq(probandListEntryId.longValue()));
}
if (trialId != null) {
listEntryCriteria.add(Restrictions.eq("trial.id", trialId.longValue()));
}
if (probandListEntryId != null) {
listEntryCriteria.add(Restrictions.idEq(probandListEntryId.longValue()));
}
if (departmentId != null) {
org.hibernate.Criteria probandCriteria = listEntryCriteria.createCriteria("proband");
probandCriteria.add(Restrictions.eq("department.id", departmentId.longValue()));
}
org.hibernate.Criteria ecrfFieldCriteria = ecrfFieldStatusEntryCriteria.createCriteria("ecrfField", "ecrfField0");
if (ecrfId != null) {
Expand Down Expand Up @@ -565,20 +567,22 @@ protected long handleGetCount(ECRFFieldStatusQueue queue, Long probandListEntryI
}

@Override
protected long handleGetCount(ECRFFieldStatusQueue queue, Long trialId, Long probandListEntryId, Long ecrfId, Long visitId, String section, boolean last)
protected long handleGetCount(ECRFFieldStatusQueue queue, Long trialId, Long departmentId, Long probandListEntryId, Long ecrfId, Long visitId, String section, boolean last)
throws Exception {
org.hibernate.Criteria ecrfFieldStatusEntryCriteria = createEcrfFieldStatusEntryCriteria("ecrfFieldStatusEntry0");
if (queue != null) {
ecrfFieldStatusEntryCriteria.add(Restrictions.eq("queue", queue));
}
org.hibernate.Criteria listEntryCriteria = ecrfFieldStatusEntryCriteria.createCriteria("listEntry", "probandListEntry0");
if (trialId != null || probandListEntryId != null) {
if (trialId != null) {
listEntryCriteria.add(Restrictions.eq("trial.id", trialId.longValue()));
}
if (probandListEntryId != null) {
listEntryCriteria.add(Restrictions.idEq(probandListEntryId.longValue()));
}
if (trialId != null) {
listEntryCriteria.add(Restrictions.eq("trial.id", trialId.longValue()));
}
if (probandListEntryId != null) {
listEntryCriteria.add(Restrictions.idEq(probandListEntryId.longValue()));
}
if (departmentId != null) {
org.hibernate.Criteria probandCriteria = listEntryCriteria.createCriteria("proband");
probandCriteria.add(Restrictions.eq("department.id", departmentId.longValue()));
}
org.hibernate.Criteria ecrfFieldCriteria = ecrfFieldStatusEntryCriteria.createCriteria("ecrfField", "ecrfField0");
if (ecrfId != null) {
Expand Down Expand Up @@ -743,7 +747,7 @@ protected Collection<ECRFFieldStatusEntry> handleGetLog(ECRFFieldStatusQueue que
listEntryCriteria.add(Restrictions.idEq(probandListEntryId.longValue()));
}
if (departmentId != null) {
org.hibernate.Criteria probandCriteria = ecrfFieldStatusEntryCriteria.createCriteria("proband");
org.hibernate.Criteria probandCriteria = listEntryCriteria.createCriteria("proband");
probandCriteria.add(Restrictions.eq("department.id", departmentId.longValue()));
}
org.hibernate.Criteria ecrfFieldCriteria = ecrfFieldStatusEntryCriteria.createCriteria("ecrfField", "ecrfField0");
Expand Down Expand Up @@ -798,7 +802,7 @@ protected Collection<ECRFFieldStatusEntry> handleGetLog(ECRFFieldStatusQueue que
listEntryCriteria.add(Restrictions.idEq(probandListEntryId.longValue()));
}
if (departmentId != null) {
org.hibernate.Criteria probandCriteria = ecrfFieldStatusEntryCriteria.createCriteria("proband");
org.hibernate.Criteria probandCriteria = listEntryCriteria.createCriteria("proband");
probandCriteria.add(Restrictions.eq("department.id", departmentId.longValue()));
}
org.hibernate.Criteria ecrfFieldCriteria = ecrfFieldStatusEntryCriteria.createCriteria("ecrfField", "ecrfField0");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5817,11 +5817,14 @@ protected ECRFFieldStatusEntryOutVO handleGetEcrfFieldStatusEntry(
}

@Override
protected long handleGetEcrfFieldStatusEntryCount(AuthenticationVO auth, ECRFFieldStatusQueue queue, Long trialId, Long probandListEntryId,
protected long handleGetEcrfFieldStatusEntryCount(AuthenticationVO auth, ECRFFieldStatusQueue queue, Long trialId, Long departmentId, Long probandListEntryId,
Long ecrfId, Long visitId, boolean last) throws Exception {
if (trialId != null) {
CheckIDUtil.checkTrialId(trialId, this.getTrialDao());
}
if (departmentId != null) {
CheckIDUtil.checkDepartmentId(departmentId, this.getDepartmentDao());
}
if (probandListEntryId != null) {
CheckIDUtil.checkProbandListEntryId(probandListEntryId, this.getProbandListEntryDao());
}
Expand All @@ -5835,7 +5838,7 @@ protected long handleGetEcrfFieldStatusEntryCount(AuthenticationVO auth, ECRFFie
throw L10nUtil.initServiceException(ServiceExceptionCodes.ECRF_VISIT_ID_IS_NULL);
}
}
return this.getECRFFieldStatusEntryDao().getCount(queue, trialId, probandListEntryId, ecrfId, visitId, last);
return this.getECRFFieldStatusEntryDao().getCount(queue, trialId, departmentId, probandListEntryId, ecrfId, visitId, last);
}

@Override
Expand All @@ -5851,11 +5854,14 @@ protected long handleGetEcrfFieldStatusEntryCount(AuthenticationVO auth, ECRFFie
}

@Override
protected long handleGetEcrfFieldStatusEntryCount(AuthenticationVO auth, ECRFFieldStatusQueue queue, Long trialId, Long probandListEntryId,
protected long handleGetEcrfFieldStatusEntryCount(AuthenticationVO auth, ECRFFieldStatusQueue queue, Long trialId, Long departmentId, Long probandListEntryId,
Long ecrfId, Long visitId, String section, boolean last) throws Exception {
if (trialId != null) {
CheckIDUtil.checkTrialId(trialId, this.getTrialDao());
}
if (departmentId != null) {
CheckIDUtil.checkDepartmentId(departmentId, this.getDepartmentDao());
}
if (probandListEntryId != null) {
CheckIDUtil.checkProbandListEntryId(probandListEntryId, this.getProbandListEntryDao());
}
Expand All @@ -5869,7 +5875,7 @@ protected long handleGetEcrfFieldStatusEntryCount(AuthenticationVO auth, ECRFFie
throw L10nUtil.initServiceException(ServiceExceptionCodes.ECRF_VISIT_ID_IS_NULL);
}
}
return this.getECRFFieldStatusEntryDao().getCount(queue, trialId, probandListEntryId, ecrfId, visitId, section, last);
return this.getECRFFieldStatusEntryDao().getCount(queue, trialId, departmentId, probandListEntryId, ecrfId, visitId, section, last);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2035,7 +2035,7 @@ public static ECRFFieldStatusEntryOutVO getEcrfFieldStatusEntry(Long id) {
public static Long getEcrfFieldStatusEntryCount(ECRFFieldStatusQueue queue, Long trialId, Long probandListEntryId, Long ecrfId, Long visitId, boolean last) {
if (trialId != null || probandListEntryId != null || ecrfId != null) {
try {
return getServiceLocator().getTrialService().getEcrfFieldStatusEntryCount(getAuthentication(), queue, trialId, probandListEntryId, ecrfId, visitId, last);
return getServiceLocator().getTrialService().getEcrfFieldStatusEntryCount(getAuthentication(), queue, trialId, null, probandListEntryId, ecrfId, visitId, last);
} catch (ServiceException | AuthorisationException | IllegalArgumentException e) {
} catch (AuthenticationException e) {
publishException(e);
Expand Down

0 comments on commit dbcfc7a

Please sign in to comment.