private void bindOrderPriority(MyOrderComponentVoCollection myOrderComponents) { // Clear Order Priority combo-box form.lyrDetails().tabGenDetails().cmbPriority().clear(); boolean hasPathologyInvestigation = hasPathologyInvestigations(myOrderComponents); boolean hasRadiologyInvestigation = hasRadiologyInvestigations(myOrderComponents); boolean hasClinicalInvestigation = hasClinicalInvestigations(myOrderComponents); OrderPriorityCollection priorities = domain.listOrderPriority(hasPathologyInvestigation, hasRadiologyInvestigation, hasClinicalInvestigation); for (int i = 0; i < priorities.size(); i++) { OrderPriority orderPriority = priorities.get(i); form.lyrDetails().tabGenDetails().cmbPriority().newRow(orderPriority, orderPriority.getText()); } form.lyrDetails().tabGenDetails().cmbPriority().removeRow(OrderPriority.VARIOUS); }
public OrderPriorityCollection listPathologyPriorities() { String pathologySystem = "Pathology System"; StringBuilder query = new StringBuilder("SELECT orderPriority.id FROM LookupInstance AS orderPriority LEFT JOIN orderPriority.type AS lookupType LEFT JOIN orderPriority.mappings AS mappings"); query.append(" WHERE lookupType.id = :ORDER_PRIORITY_TYPE AND orderPriority.active = 1 AND mappings.extSystem = :PATHOLOGY_SYSTEM ORDER BY orderPriority.id"); ArrayList<String> paramNames = new ArrayList<String>(); ArrayList<Object> paramValues = new ArrayList<Object>(); paramNames.add("ORDER_PRIORITY_TYPE"); paramValues.add(OrderPriority.TYPE_ID); paramNames.add("PATHOLOGY_SYSTEM"); paramValues.add(pathologySystem); List<?> pathologyPriorities = getDomainFactory().find(query.toString(), paramNames, paramValues); OrderPriorityCollection resultsPathology = new OrderPriorityCollection(); for (int i = 0; i < pathologyPriorities.size(); i++) resultsPathology.add(LookupHelper.getOrderPriorityInstance(getLookupService(), (Integer) pathologyPriorities.get(i))); return resultsPathology; }
public OrderPriorityCollection listRadiologyPriorities() { String radiologySystem = "Radiology System"; StringBuilder query = new StringBuilder("SELECT orderPriority.id FROM LookupInstance AS orderPriority LEFT JOIN orderPriority.type AS lookupType LEFT JOIN orderPriority.mappings AS mappings"); query.append(" WHERE lookupType.id = :ORDER_PRIORITY_TYPE AND orderPriority.active = 1 AND mappings.extSystem = :RADIOLOGY_SYSTEM ORDER BY orderPriority.id"); ArrayList<String> paramNames = new ArrayList<String>(); ArrayList<Object> paramValues = new ArrayList<Object>(); paramNames.add("ORDER_PRIORITY_TYPE"); paramValues.add(OrderPriority.TYPE_ID); paramNames.add("RADIOLOGY_SYSTEM"); paramValues.add(radiologySystem); List<?> radiologyPriorities = getDomainFactory().find(query.toString(), paramNames, paramValues); OrderPriorityCollection resultsRadiology = new OrderPriorityCollection(); for (int i = 0; i < radiologyPriorities.size(); i++) resultsRadiology.add(LookupHelper.getOrderPriorityInstance(getLookupService(), (Integer) radiologyPriorities.get(i))); return resultsRadiology; }
public OrderPriorityCollection listClinicalPriorities() { String clinicalSystem = "Clinical Mapping"; StringBuilder query = new StringBuilder("SELECT orderPriority.id FROM LookupInstance AS orderPriority LEFT JOIN orderPriority.type AS lookupType LEFT JOIN orderPriority.mappings AS mappings"); query.append(" WHERE lookupType.id = :ORDER_PRIORITY_TYPE AND orderPriority.active = 1 AND mappings.extSystem = :CLINICAL_SYSTEM ORDER BY orderPriority.id"); ArrayList<String> paramNames = new ArrayList<String>(); ArrayList<Object> paramValues = new ArrayList<Object>(); paramNames.add("ORDER_PRIORITY_TYPE"); paramValues.add(OrderPriority.TYPE_ID); paramNames.add("CLINICAL_SYSTEM"); paramValues.add(clinicalSystem); List<?> clinicalPriorities = getDomainFactory().find(query.toString(), paramNames, paramValues); OrderPriorityCollection resultsClinical = new OrderPriorityCollection(); for (int i = 0; i < clinicalPriorities.size(); i++) resultsClinical.add(LookupHelper.getOrderPriorityInstance(getLookupService(), (Integer) clinicalPriorities.get(i))); return resultsClinical; }