public MDTPatientCustomListVo saveCustomList(CustomListVo customListVo, MDTPatientCustomListVo patientCustomListVo) throws StaleObjectException { if (!patientCustomListVo.isValidated()) { throw new DomainRuntimeException("CustomList has not been validated"); } DomainFactory factory = getDomainFactory(); CustomList doCustomList = CustomListVoAssembler.extractCustomList(factory, customListVo); factory.save(doCustomList); MDTPatientCustomList doPatientCustomList = MDTPatientCustomListVoAssembler.extractMDTPatientCustomList(factory, patientCustomListVo); doPatientCustomList.setCustomListType(doCustomList); factory.save(doPatientCustomList); return MDTPatientCustomListVoAssembler.create(doPatientCustomList); }
/** * list custom lists */ public ims.core.vo.CustomListVoCollection listCustomLists(ims.core.resource.people.vo.MemberOfStaffRefVo voMOSRefVo) { DomainFactory factory = getDomainFactory(); String hql = " from CustomList cl "; StringBuffer condStr = new StringBuffer(); String andStr = " "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); if (voMOSRefVo != null) { condStr.append(" where cl.listOwner.id = :idMOS"); markers.add("idMOS"); values.add(voMOSRefVo.getID_MemberOfStaff()); condStr.append(" and cl.isActive = :isActive"); } else condStr.append(" where cl.isActive = :isActive"); markers.add("isActive"); values.add(Boolean.TRUE); if (andStr.equals(" and ")) hql += " where "; hql += condStr.toString(); return CustomListVoAssembler.createCustomListVoCollectionFromCustomList(factory.find(hql, markers, values)).sort(); }
/** * save a service and associated functions/activities */ public ims.core.vo.CustomListVo saveCustomList(ims.core.vo.CustomListVo voCustomList) throws ims.domain.exceptions.StaleObjectException { if (!voCustomList.isValidated()) { throw new DomainRuntimeException("This voCustomList has not been validated"); } DomainFactory factory = getDomainFactory(); CustomList domCL = CustomListVoAssembler.extractCustomList(factory, voCustomList); factory.save(domCL); return CustomListVoAssembler.create(domCL); }
public CustomListVo getCustomList(CustomListRefVo customListRef) { if (customListRef == null || customListRef.getID_CustomList() == null) throw new CodingRuntimeException("Cannot get CustomListVo record details for a null CustomListRefVo reference"); DomainFactory factory = getDomainFactory(); CustomList customListDO = (CustomList) factory.getDomainObject(CustomList.class, customListRef.getID_CustomList()); return CustomListVoAssembler.create(customListDO); }
public CustomListVoCollection listCustomListTypes(CustomListVo filter) { if(filter == null) throw new CodingRuntimeException("null type passed to listCustomListTypes() !"); DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" "); String query = "from CustomList as cl "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; if (filter.getListTypeIsNotNull()) { hql.append(andStr + " cl.listType.id = :ListType"); markers.add("ListType"); values.add(filter.getListType().getID()); andStr = " and "; } if (filter.getListNameIsNotNull()) { hql.append(andStr + " cl.listName = :ListName"); markers.add("ListName"); values.add(filter.getListName()); andStr = " and "; } if (filter.getSpecialtyIsNotNull()) { hql.append(andStr + " cl.specialty.id = :Specialty"); markers.add("Specialty"); values.add(filter.getSpecialty().getID()); andStr = " and "; } if (filter.getDateIsNotNull()) { hql.append(andStr + " cl.date = :Date"); markers.add("Date"); values.add(filter.getDate().getDate()); andStr = " and "; } if (filter.getListOwnerIsNotNull()) { hql.append(andStr + " cl.listOwner.id = :ListOwner"); markers.add("ListOwner"); values.add(filter.getListOwner().getID_MemberOfStaff()); andStr = " and "; } if (filter.getIsActiveIsNotNull()) { hql.append(andStr + " cl.isActive = :IsActive"); markers.add("IsActive"); values.add(filter.getIsActive()); andStr = " and "; } if (andStr.equals(" and ")) query += " where "; query += hql.toString(); List list = factory.find(query, markers, values); if(list.size() == 0) return null; return CustomListVoAssembler.createCustomListVoCollectionFromCustomList(list).sort(); }
/** * list custom lists */ public CustomListVoCollection listCustomLists(MemberOfStaffRefVo voMOSRefVo, Boolean showReadOnlyRecords) { DomainFactory factory = getDomainFactory(); String hql = " from CustomList cl "; StringBuffer condStr = new StringBuffer(); String andStr = " "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); if (voMOSRefVo != null) { condStr.append(" where (cl.listOwner.id = :idMOS"); markers.add("idMOS"); values.add(voMOSRefVo.getID_MemberOfStaff()); //WDEV-18640 condStr.append(" or cl.isFullAccess = :isFullAccess"); markers.add("isFullAccess"); values.add(Boolean.TRUE); if (Boolean.TRUE.equals(showReadOnlyRecords)) { condStr.append(" or cl.isReadOnly = :isReadOnly"); markers.add("isReadOnly"); values.add(Boolean.TRUE); } condStr.append(")"); ////WDEV-18640 ---- ends here condStr.append(" and cl.isActive = :isActive"); } else condStr.append(" where cl.isActive = :isActive"); markers.add("isActive"); values.add(Boolean.TRUE); if (andStr.equals(" and ")) hql += " where "; hql += condStr.toString(); return CustomListVoAssembler.createCustomListVoCollectionFromCustomList(factory.find(hql, markers, values)).sort(); }