/** * go through all the order investigations for this specimen and get each investigations helptext collection - if we find a helptext item with category set to HelpTextCategory.INSTRUCTIONSTOCOLLECTOR append the text of the item to the invest name and then to the returned string * * @param voSpecimen * @return String */ private String buildInstructionsToCollector(OrderSpecimenVo voSpecimen) { StringBuffer sb = new StringBuffer(); for (int i = 0; i < voSpecimen.getInvestigations().size(); i++) { InvestigationUnderSpecimenVo voInvestItem = getInvestUnderSpecimenVoFromContextByOrderInvestigation(voSpecimen.getInvestigations().get(i)); if (voInvestItem != null && voInvestItem.getHelpTextIsNotNull()) { for (int p = 0; p < voInvestItem.getHelpText().size(); p++) { if (voInvestItem.getHelpText().get(p).getTextCategory().equals(HelpTextCategory.INSTRUCTIONSTOCOLLECTOR)) { sb.append(voInvestItem.getInvestigationIndex().getName() + PhlebotomyHelper.INSTRUCTION_TO_COLLECTOR + voInvestItem.getHelpText().get(p).getHelpText()); } } } } return sb.toString().length() > 0 ? sb.toString() : null; }
private InvestigationUnderSpecimenVo getInvestUnderSpecimenVoFromContextByOrderInvestigation(OrderInvestigationRefVo voOrderInvestigation) { OrderInvestigationVoCollection voCollOrderInvestigation = form.getGlobalContext().OCRR.getOrderInvestigationCollection(); if (voCollOrderInvestigation != null && voCollOrderInvestigation.size() > 0) { for (int i = 0; i < voCollOrderInvestigation.size(); i++) { if (voCollOrderInvestigation.get(i).equals(voOrderInvestigation)) return voCollOrderInvestigation.get(i).getInvestigation(); } } return null; }
public InvestigationUnderSpecimenVo getInvestigationUnderSpecimen(Integer idInvestigation) { if (idInvestigation == null) throw new DomainRuntimeException("No id provided for getInvestigationUnderSpecimen"); DomainFactory factory = getDomainFactory(); return InvestigationUnderSpecimenVoAssembler.create((Investigation) factory.getDomainObject(Investigation.class, idInvestigation)); }