private void addToList(InvestShortVo item) { if(item == null) return; if(form.getGlobalContext().OCRR.getCurrentInvestigationIsNotNull()) if(item.equals(form.getGlobalContext().OCRR.getCurrentInvestigation())) return; GenForm.grdListedTestsRow row = form.grdListedTests().getRows().newRow(); row.setValue(item); if(item.getInvestigationIndexIsNotNull()) { boolean isAdditionalInfoToBeShown = ConfigFlag.UI.OCRR_APPEND_PROVER_SERVICE_NAME_TO_INVESTIGATION_NAME.getValue(); row.setcolName(isAdditionalInfoToBeShown == true ? item.getNameWithLocationInfo() : item.getName()); row.setTooltip("Description: " + item.getInvestigationIndex().getDescription()); if(item.getInvestigationIndex().getIsProfileIsNotNull() && item.getInvestigationIndex().getIsProfile().booleanValue()) row.setcolImage(form.getImages().OCRR.Profile); else row.setcolImage(form.getImages().OCRR.Investigation); } }
private boolean wasInvastigationPreselected(InvestShortVo item) { if(form.getGlobalContext().OCRR.getItemSelectionTypeIsNotNull()) { if(form.getGlobalContext().OCRR.getItemSelectionType().equals(ItemSelectionType.INVESTIGATION) && form.getGlobalContext().OCRR.getPreselectedInvestigationsIsNotNull()) { for(int x = 0; x < form.getGlobalContext().OCRR.getPreselectedInvestigations().size(); x++) { InvestShortVo existingItem = form.getGlobalContext().OCRR.getPreselectedInvestigations().get(x); if(existingItem != null && existingItem.equals(item)) return true; } } } return false; }
private boolean wasProfilePreselected(InvestShortVo item) { if(form.getGlobalContext().OCRR.getItemSelectionTypeIsNotNull()) { if(form.getGlobalContext().OCRR.getItemSelectionType().equals(ItemSelectionType.PROFILE) && form.getGlobalContext().OCRR.getPreselectedProfilesIsNotNull()) { for(int x = 0; x < form.getGlobalContext().OCRR.getPreselectedProfiles().size(); x++) { InvestShortVo existingItem = form.getGlobalContext().OCRR.getPreselectedProfiles().get(x); if(existingItem != null && existingItem.equals(item)) return true; } } } return false; }
private GenderInvestigationVoCollection isInvAppropriate(GenderSpecific instGenderSpecific, boolean isFemale, InvestShortVo investShortVo) { GenderInvestigationVoCollection invColl = new GenderInvestigationVoCollection(); if (instGenderSpecific != null) { if (!instGenderSpecific.equals(GenderSpecific.NOTAPPLICABLE)) { if (instGenderSpecific.equals(GenderSpecific.FEMALE)) { if (!isFemale) { invColl.add(getGenderInvestigationFromInvestShort(investShortVo)); } } else if (instGenderSpecific.equals(GenderSpecific.MALE)) { if (isFemale) { invColl.add(getGenderInvestigationFromInvestShort(investShortVo)); } } } } return invColl.size() > 0 ? invColl : null; }
private GenderInvestigationVo getGenderInvestigationFromInvestShort(InvestShortVo investShortVo) { if(investShortVo == null) return null; GenderInvestigationVo inv = new GenderInvestigationVo(investShortVo.getID_Investigation(), investShortVo.getVersion_Investigation()); InvestigationIndexForGenderInvestigationVo invIndex = new InvestigationIndexForGenderInvestigationVo(investShortVo.getInvestigationIndex().getID_InvestigationIndex(), investShortVo.getInvestigationIndex().getVersion_InvestigationIndex()); invIndex.setName(investShortVo.getInvestigationIndex().getName()); invIndex.setIsProfile(investShortVo.getInvestigationIndex().getIsProfile()); inv.setInvestigationIndex(invIndex); return inv; }
private void markUnmarkComponent(InvestShortVo item, boolean isProfile, boolean mark, boolean isChildComponent, String reorderReason) { if (item != null && item.getID_InvestigationIsNotNull() && item.getInvestigationIndexIsNotNull()) { SelectedComponentFromSelectOrderVo component = new SelectedComponentFromSelectOrderVo(); component.setID(item.getID_Investigation()); component.setComponentType(isProfile ? SelectAndOrderComponentType.PROFILE : SelectAndOrderComponentType.INVESTIGATION); component.setText(item.getInvestigationIndex().getName()); component.setCategory(item.getInvestigationIndex().getCategory()); component.setTooltip(getComponentInvestigationTooltip(item)); component.setIsAddon(item.getIsAddon()); component.setRequiresSite(item.getInvestigationIndex().getRequiresSiteSpecifier()); component.setMinReOrderPeriod(item.getMinReorderPeriodUnit()); component.setMinReOrderVal(item.getMinReorderPeriodVal()); component.setMinReOrderFemalePeriod(item.getFemaleMinReorderPeriodUnit()); component.setMinReOrderFemaleVal(item.getFemaleMinReorderPeriodVal()); component.setPhlebMayCollect(item.getInvestigationIndex().getPhlebMayCollect()); component.setGenderSpecific(item.getInvestigationIndex().getGenderSpecific()); component.setReOrderReason(reorderReason);//WDEV-16624 component.setAssociatedInvestigations(item.getAssocInvestigations());//WDEV-16624 if (item.getProviderServiceIsNotNull() && item.getProviderService().getLocationServiceIsNotNull() && item.getProviderService().getLocationService().getServiceIsNotNull()) component.setServiceID(item.getProviderService().getLocationService().getService().getID_Service()); if (item.getActiveStatusIsNotNull() && item.getActiveStatus().equals(PreActiveActiveInactiveStatus.ACTIVE)) addRemoveSelection(component, mark, isChildComponent); } }
private String getComponentInvestigationTooltip(InvestShortVo investigation) { if (investigation == null) return ""; StringBuilder tooltip = new StringBuilder(); tooltip.append(investigation.getInvestigationIndex().getDescription()); if (investigation.getTurnaroundMeasureIsNotNull() && investigation.getExpectedTurnaroundIsNotNull()) { tooltip.append(" - Expected Turn Around: "); tooltip.append(investigation.getExpectedTurnaround().toString()); tooltip.append(" ").append(investigation.getTurnaroundMeasure().getText()); } else if (investigation.getProviderServiceIsNotNull() && investigation.getProviderService().getLocationServiceIsNotNull() && investigation.getProviderService().getLocationService().getServiceIsNotNull() && investigation.getProviderService().getLocationService().getService().getExpectedTurnaround() != null) { tooltip.append(" - Expected Turn Around: "); tooltip.append(investigation.getProviderService().getLocationService().getService().getExpectedTurnaround().toString()); tooltip.append(" ").append(investigation.getProviderService().getLocationService().getService().getTurnaroundMeasure().getText()); } // Amend '&' characters with space not to cause problems in tool tip boxes // as these are HTML and '&' is a special character for (int i = tooltip.length() - 1; i >= 0; i--) { if (tooltip.charAt(i) == '&' && i < tooltip.length() - 1 && tooltip.charAt(i + 1) != ' ') tooltip.insert(i, " "); } return tooltip.toString(); }
private void populateExistingLinkedTests() { InvestShortVoCollection investigations = new InvestShortVoCollection(); for (int x = 0; x < form.lyrInvestigations().tabLinkedInvestigations().grdTests().getRows().size(); x++) { InvestShortVo item = form.lyrInvestigations().tabLinkedInvestigations().grdTests().getRows().get(x).getValue(); if (item != null) { if (item.getInvestigationIndexIsNotNull()) investigations.add(item); } } form.getGlobalContext().OCRR.setPreselectedInvestigations(investigations); }
private void addToSelection(InvestShortVo item, boolean canBeRemoved) { GenForm.grdSelectedTestsRow row = form.grdSelectedTests().getRows().newRow(); row.setValue(item); if(item.getInvestigationIndexIsNotNull()) { row.setReadOnly(!canBeRemoved); boolean isAdditionalInfoToBeShown = ConfigFlag.UI.OCRR_APPEND_PROVER_SERVICE_NAME_TO_INVESTIGATION_NAME.getValue(); row.setcolName(isAdditionalInfoToBeShown == true ? item.getNameWithLocationInfo() : item.getName()); if(item.getInvestigationIndex().getIsProfileIsNotNull() && item.getInvestigationIndex().getIsProfile().booleanValue()) row.setcolImage(form.getImages().OCRR.Profile); else row.setcolImage(form.getImages().OCRR.Investigation); } }
private String getComponentInvestigationTooltip(InvestShortVo result) { if (result == null) return ""; StringBuilder tooltip = new StringBuilder(); tooltip.append(result.getInvestigationIndex().getDescription()); if (result.getTurnaroundMeasureIsNotNull() && result.getExpectedTurnaroundIsNotNull()) { tooltip.append(" - Expected Turn Around: "); tooltip.append(result.getExpectedTurnaround().toString()); tooltip.append(" ").append(result.getTurnaroundMeasure().getText()); } else if (result.getProviderServiceIsNotNull() && result.getProviderService().getLocationServiceIsNotNull() && result.getProviderService().getLocationService().getServiceIsNotNull() && result.getProviderService().getLocationService().getService().getExpectedTurnaround() != null) { tooltip.append(" - Expected Turn Around: "); tooltip.append(result.getProviderService().getLocationService().getService().getExpectedTurnaround().toString()); if(result.getProviderService().getLocationService().getService().getTurnaroundMeasure() != null) tooltip.append(" ").append(result.getProviderService().getLocationService().getService().getTurnaroundMeasure().getText()); } // Amend '&' characters with space not to cause problems in tool tip boxes // as these are HTML and '&' is a special character for (int i = tooltip.length() - 1; i >= 0; i--) { if (tooltip.charAt(i) == '&' && i < tooltip.length() - 1 && tooltip.charAt(i + 1) != ' ') tooltip.insert(i, " "); } return tooltip.toString(); }
private String getComponentInvestigationTooltip(InvestShortVo result) { if (result == null) return ""; StringBuilder tooltip = new StringBuilder(); tooltip.append(result.getInvestigationIndex().getDescription()); if (result.getTurnaroundMeasureIsNotNull() && result.getExpectedTurnaroundIsNotNull()) { tooltip.append(" - Expected Turn Around: "); tooltip.append(result.getExpectedTurnaround().toString()); tooltip.append(" ").append(result.getTurnaroundMeasure().getText()); } else if (result.getProviderServiceIsNotNull() && result.getProviderService().getLocationServiceIsNotNull() && result.getProviderService().getLocationService().getServiceIsNotNull() && result.getProviderService().getLocationService().getService().getExpectedTurnaround() != null) { tooltip.append(" - Expected Turn Around: "); tooltip.append(result.getProviderService().getLocationService().getService().getExpectedTurnaround().toString()); tooltip.append(" ").append(result.getProviderService().getLocationService().getService().getTurnaroundMeasure().getText()); } // Amend '&' characters with space not to cause problems in tool tip boxes // as these are HTML and '&' is a special character for (int i = tooltip.length() - 1; i >= 0; i--) { if (tooltip.charAt(i) == '&' && i < tooltip.length() - 1 && tooltip.charAt(i + 1) != ' ') tooltip.insert(i, " "); } return tooltip.toString(); }