use of gov.nih.nci.ctd2.dashboard.impl.ObservationTemplateImpl in project nci-ctd2-dashboard by CBIIT.
the class DashboardDaoImpl method findObservedSubjectRole.
@Override
public ObservedSubjectRole findObservedSubjectRole(String templateName, String columnName) {
List<ObservedSubjectRole> list = new ArrayList<ObservedSubjectRole>();
// first grab observation template name
List<ObservationTemplate> otList = queryWithClass("from ObservationTemplateImpl where displayName = :templateName", "templateName", templateName);
for (ObservationTemplate ot : otList) {
List<ObservedSubjectRole> osrList = query2ParamsWithClass("from ObservedSubjectRoleImpl as osr where columnName = :columnName and " + "osr.observationTemplate = :ot", "columnName", columnName, "ot", ot);
for (ObservedSubjectRole o : osrList) {
list.add(o);
}
}
assert list.size() <= 1;
return (list.size() == 1) ? list.iterator().next() : null;
}
use of gov.nih.nci.ctd2.dashboard.impl.ObservationTemplateImpl in project nci-ctd2-dashboard by CBIIT.
the class DashboardDaoImpl method findObservedEvidenceRole.
@Override
public ObservedEvidenceRole findObservedEvidenceRole(String templateName, String columnName) {
List<ObservedEvidenceRole> list = new ArrayList<ObservedEvidenceRole>();
// first grab observation template name
List<ObservationTemplate> otList = queryWithClass("from ObservationTemplateImpl where displayName = :templateName", "templateName", templateName);
for (ObservationTemplate ot : otList) {
List<ObservedEvidenceRole> oerList = query2ParamsWithClass("from ObservedEvidenceRoleImpl as oer where columnName = :columnName and " + "oer.observationTemplate = :ot", "columnName", columnName, "ot", ot);
for (ObservedEvidenceRole o : oerList) {
list.add(o);
}
}
assert list.size() <= 1;
return (list.size() == 1) ? list.iterator().next() : null;
}
use of gov.nih.nci.ctd2.dashboard.impl.ObservationTemplateImpl in project nci-ctd2-dashboard by CBIIT.
the class DashboardDaoImpl method findSubmissionByIsStory.
@Override
public List<Submission> findSubmissionByIsStory(boolean isSubmissionStory, boolean sortByPriority) {
List<ObservationTemplate> tmpList1 = queryWithClass("from ObservationTemplateImpl where isSubmissionStory = :iss order by submissionStoryRank desc", "iss", isSubmissionStory);
List<ObservationTemplate> tmpList2 = queryWithClass("from ObservationTemplateImpl where isSubmissionStory = :iss", "iss", isSubmissionStory);
List<ObservationTemplate> tmpList = sortByPriority ? tmpList1 : tmpList2;
List<Submission> list = new ArrayList<Submission>();
for (ObservationTemplate o : tmpList) {
list.addAll(findSubmissionByObservationTemplate(o));
}
return list;
}
Aggregations