/** * @param voTaxonomyMap * @return */ private String getTaxonomyName(NonUniqueTaxonomyMapVo voTaxonomyMap) { StringBuffer name = new StringBuffer(); if (voTaxonomyMap != null) { if (voTaxonomyMap.getTaxonomyNameIsNotNull()) { name.append(voTaxonomyMap.getTaxonomyName().toString()); name.append(voTaxonomyMap.getTaxonomyCodeIsNotNull() ? " - " : ""); } if (voTaxonomyMap.getTaxonomyCodeIsNotNull()) { name.append(voTaxonomyMap.getTaxonomyCode()); } } return name.toString(); }
private NonUniqueTaxonomyMapVoCollection getMappingsNoWarnings() { NonUniqueTaxonomyMapVoCollection voTaxonomyMapCollection = new NonUniqueTaxonomyMapVoCollection(); for (int i = 0; i < form.grdMappings().getRows().size(); i++) { ims.admin.forms.nonuniquetaxonomymappings.GenForm.grdMappingsRow row = form.grdMappings().getRows().get(i); NonUniqueTaxonomyMapVo voTaxonomyMap = row.getValue() != null ? row.getValue() : new NonUniqueTaxonomyMapVo(); voTaxonomyMap.setTaxonomyCode(row.getcolCode()); voTaxonomyMap.setTaxonomyName((TaxonomyType) row.getcolExtCodeType()); if (row.getcolCode() != null || row.getcolExtCodeType() != null) voTaxonomyMapCollection.add(voTaxonomyMap); } return voTaxonomyMapCollection; }
private void populateNUTaxonomyMappings(ims.vo.interfaces.ITaxonomyMapCollection coll)//http://jira/browse/WDEV-20066 { form.lyrDetails().tabNUMappings().grdNUmappings().getRows().clear();//WDEV-1921 if (coll != null) { grdNUmappingsRow row = null; for (int i=0; i < coll.size(); i++) { NonUniqueTaxonomyMapVo data = (NonUniqueTaxonomyMapVo)coll.getITaxonomyMap(i); row = form.lyrDetails().tabNUMappings().grdNUmappings().getRows().newRow();//WDEV-1921 row.setcolExtCodeType(data.getTaxonomyName()); row.setcolCode(data.getTaxonomyCode()); row.setcolEffectiveFrom(data.getEffectiveFrom()); row.setcolEffectiveTo(data.getEffectiveTo()); NonUniqueTaxonomyMapVo tm = new NonUniqueTaxonomyMapVo(); tm.setTaxonomyCode(data.getTaxonomyCode()); tm.setTaxonomyName(data.getTaxonomyName()); tm.setEffectiveFrom(data.getEffectiveFrom()); tm.setEffectiveTo(data.getEffectiveTo()); row.setValue(tm); } } }
private NonUniqueTaxonomyMapVoCollection getMappingsNoWarnings() { NonUniqueTaxonomyMapVoCollection voTaxonomyMapCollection = new NonUniqueTaxonomyMapVoCollection(); for (int i = 0; i < form.grdMappings().getRows().size(); i++) { ims.admin.forms.nonuniquetaxonomymappings.GenForm.grdMappingsRow row = form.grdMappings().getRows().get(i); NonUniqueTaxonomyMapVo voTaxonomyMap = row.getValue() != null ? row.getValue() : new NonUniqueTaxonomyMapVo(); voTaxonomyMap.setTaxonomyCode(row.getcolCode()); voTaxonomyMap.setTaxonomyName((TaxonomyType) row.getcolExtCodeType()); if (row.getcolCode() != null || row.getcolExtCodeType() != null) { if(taxonomyIsNotAdded(voTaxonomyMapCollection, voTaxonomyMap)) { voTaxonomyMapCollection.add(voTaxonomyMap); } } } return voTaxonomyMapCollection; }
private boolean taxonomyIsNotAdded(NonUniqueTaxonomyMapVoCollection coll, NonUniqueTaxonomyMapVo record) { if(coll == null) return false; if(record == null) return false; for(NonUniqueTaxonomyMapVo item : coll) { if(item == null) continue; if(item.getTaxonomyName().equals(record.getTaxonomyName()) && item.getTaxonomyCode().equals(record.getTaxonomyCode())) return false; } return true; }
private void populateDataFromAnswerOptions(QuestionAnswerTypeVo voQAnswerType) { AnswerOptionVoCollection voColl = new AnswerOptionVoCollection(); for (int i = 0; i < form.grdAnswerOption().getRows().size(); i++) { grdAnswerOptionRow row = form.grdAnswerOption().getRows().get(i); AnswerOptionVo voAnswerOption = row.getValue() != null ? row.getValue() : new AnswerOptionVo(); voAnswerOption.setOptionText(row.getcolOptionText()); voAnswerOption.setOptionDescription(row.getcolOptionDesc()); voAnswerOption.setScore(row.getcolScore()); Object objCol = row.getcolColour(); if (objCol instanceof Color) voAnswerOption.setColour((Color) objCol); else voAnswerOption.setColour(null); NonUniqueTaxonomyMapVoCollection voTaxonomyColl = new NonUniqueTaxonomyMapVoCollection(); NonUniqueTaxonomyMapVo voTaxonomyMap = new NonUniqueTaxonomyMapVo(); if (row.getcolExtCodeType()==null&&(row.getcolCode()==null||row.getcolCode().equals(""))) voAnswerOption.setTaxonomyMappings(null); else { voTaxonomyMap.setTaxonomyName(row.getcolExtCodeType()); voTaxonomyMap.setTaxonomyCode(row.getcolCode()); voTaxonomyColl.add(voTaxonomyMap); voAnswerOption.setTaxonomyMappings(voTaxonomyColl); } voColl.add(voAnswerOption); } voQAnswerType.setOptions(voColl); }
private NonUniqueTaxonomyMapVo getNonUniqueTaxonomyMap(ims.core.vo.TaxonomyMap map) { if(map != null) { NonUniqueTaxonomyMapVo voNonUniqueTaxonomyMap = new NonUniqueTaxonomyMapVo(); voNonUniqueTaxonomyMap.setTaxonomyCode(map.getTaxonomyCode()); voNonUniqueTaxonomyMap.setTaxonomyName(map.getTaxonomyName()); return voNonUniqueTaxonomyMap; } return null; }
/** * @param newRow * @param voAnswerOption */ private void setColTaxonomy(GenForm.grdAnswerOptionRow newRow, NonUniqueTaxonomyMapVo voTaxonomyMap) { if (newRow != null && voTaxonomyMap != null) { newRow.setcolExtCodeType(voTaxonomyMap.getTaxonomyName()); newRow.setcolCode(voTaxonomyMap.getTaxonomyCode()); AnswerOptionVo voAnswerOption = newRow.getValue() != null ? newRow.getValue() : new AnswerOptionVo(); NonUniqueTaxonomyMapVoCollection voTaxonomyColl = new NonUniqueTaxonomyMapVoCollection(); voTaxonomyColl.add(voTaxonomyMap); voAnswerOption.setTaxonomyMappings(voTaxonomyColl); newRow.setValue(voAnswerOption); } }
private NonUniqueTaxonomyMapVoCollection getMappings() { NonUniqueTaxonomyMapVoCollection voTaxonomyMapCollection = new NonUniqueTaxonomyMapVoCollection(); for (int i = 0; i < form.grdMappings().getRows().size(); i++) { ims.admin.forms.nonuniquetaxonomymappings.GenForm.grdMappingsRow row = form.grdMappings().getRows().get(i); NonUniqueTaxonomyMapVo voTaxonomyMap = row.getValue() != null ? row.getValue() : new NonUniqueTaxonomyMapVo(); voTaxonomyMap.setTaxonomyCode(row.getcolCode()); voTaxonomyMap.setTaxonomyName((TaxonomyType) row.getcolExtCodeType()); if (row.getcolCode() != null && row.getcolExtCodeType() != null) voTaxonomyMapCollection.add(voTaxonomyMap); else { StringBuffer sb = new StringBuffer(); sb.append("The taxonomy mapping of Type "); sb.append(row.getcolExtCodeType() != null ? "'" + ((TaxonomyType) row.getcolExtCodeType()).getText()+ "'" : "???"); sb.append(" and Value of "); sb.append(row.getcolCode() != null ? "'" + row.getcolCode().toString()+ "'" : "???"); sb.append(" will not be held for saving due to missing data."); engine.showMessage(sb.toString(),"Missing data", MessageButtons.OK, MessageIcon.WARNING); } } return voTaxonomyMapCollection; }
private void addTaxonomy() { form.grdMappings().getRows().newRow(true).setValue(new NonUniqueTaxonomyMapVo()); form.grdMappings().resetScrollPosition(); updateControlsState(); }
@Override protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException { if ( (formName.equals(form.getForms().Core.TaxonomySearch)) && (result.equals(DialogResult.OK))) { if (form.getLocalContext().getLockedIsNotNull() && form.getLocalContext().getLocked().equals(Boolean.TRUE)) { if(form.getGlobalContext().Core.getTaxonomyMapIsNotNull()) { TaxonomyMap voTaxonomyMapUnique = form.getGlobalContext().Core.getTaxonomyMap(); NonUniqueTaxonomyMapVo voTaxonomyMap = new NonUniqueTaxonomyMapVo(); voTaxonomyMap.setTaxonomyCode(voTaxonomyMapUnique.getTaxonomyCode()); voTaxonomyMap.setTaxonomyName(voTaxonomyMapUnique.getTaxonomyName()); NonUniqueTaxonomyMapVo selectedRecord = form.getLocalContext().getSelectedRecord(); ims.admin.forms.nonuniquetaxonomymappings.GenForm.grdMappingsRow row = null; if (selectedRecord == null) { row = form.grdMappings().getRows().newRow(); } else { row = form.grdMappings().getRowByValue(selectedRecord); } populateTaxonomy(row, voTaxonomyMap); updateControlsState(); form.getLocalContext().setLocked(Boolean.FALSE); } } } //wdev-12200 updateControlsState(); //------------- }
private void populateTaxonomy(ims.admin.forms.nonuniquetaxonomymappings.GenForm.grdMappingsRow row, NonUniqueTaxonomyMapVo voTaxonomyMap) { if(row != null && voTaxonomyMap != null) { row.setcolExtCodeType(voTaxonomyMap.getTaxonomyName()); row.setcolCode(voTaxonomyMap.getTaxonomyCode()); row.setValue(voTaxonomyMap); } }
/** * Adds a new row to the taxonomy grid then updates the context menus to reflect this * @param void * @return void */ private void addTaxonomy() { if (form.rdoGrp().getValue().equals(rdoGrpEnumeration.rdoProcedures))//http://jira/browse/WDEV-20066 { form.lyrDetails().tabNUMappings().grdNUmappings().getRows().newRow(true).setValue(new NonUniqueTaxonomyMapVo());//WDEV-11921 } else { form.lyrDetails().tabMappings().grdMappings().getRows().newRow(true).setValue(new TaxonomyMap());//WDEV-11921 } updateControlsState(); }
private NonUniqueTaxonomyMapVoCollection getMappings() { NonUniqueTaxonomyMapVoCollection voTaxonomyMapCollection = new NonUniqueTaxonomyMapVoCollection(); for (int i = 0; i < form.grdMappings().getRows().size(); i++) { ims.admin.forms.nonuniquetaxonomymappings.GenForm.grdMappingsRow row = form.grdMappings().getRows().get(i); NonUniqueTaxonomyMapVo voTaxonomyMap = row.getValue() != null ? row.getValue() : new NonUniqueTaxonomyMapVo(); voTaxonomyMap.setTaxonomyCode(row.getcolCode()); voTaxonomyMap.setTaxonomyName((TaxonomyType) row.getcolExtCodeType()); if (row.getcolCode() != null && row.getcolExtCodeType() != null) { if(voTaxonomyMapCollection.indexOf(voTaxonomyMap) < 0) { voTaxonomyMapCollection.add(voTaxonomyMap); } } else { StringBuffer sb = new StringBuffer(); sb.append("The taxonomy mapping of Type "); sb.append(row.getcolExtCodeType() != null ? "'" + ((TaxonomyType) row.getcolExtCodeType()).getText()+ "'" : "???"); sb.append(" and Value of "); sb.append(row.getcolCode() != null ? "'" + row.getcolCode().toString()+ "'" : "???"); sb.append(" will not be held for saving due to missing data."); engine.showMessage(sb.toString(),"Missing data", MessageButtons.OK, MessageIcon.WARNING); } } return voTaxonomyMapCollection; }
private String areMappingsPairInUse(HrgConfigVo configuration, DomainFactory df) { if (configuration == null || !configuration.getMappingsIsNotNull()) return null; ArrayList<String> opcsValue = new ArrayList<String>(); ArrayList<String> icdValue = new ArrayList<String>(); for (int i = 0; i < configuration.getMappings().size(); i++) { NonUniqueTaxonomyMapVo tmVo = configuration.getMappings().get(i); if (TaxonomyType.OPCS4.equals(tmVo.getTaxonomyName())) { opcsValue.add(tmVo.getTaxonomyCode()); } else { if (TaxonomyType.ICD10.equals(tmVo.getTaxonomyName())) { icdValue.add(tmVo.getTaxonomyCode()); } } } if (opcsValue.size() == 0 || icdValue.size() == 0) return null; String select = "select distinct hrgC.hRGCode from HrgConfig as hrgC " + "left join hrgC.mappings as mapp left join mapp.taxonomyName as tnm where " + "(hrgC.id in (select distinct subhrgC.id from HrgConfig as subhrgC " + "left join subhrgC.mappings as submapp left join submapp.taxonomyName as subtnm where " + "(submapp.taxonomyCode in (" + getStringForHql(opcsValue) + ") and subtnm.id = " + TaxonomyType.OPCS4.getID() + (configuration.getID_HrgConfigIsNotNull() ? (" and subhrgC.id<>" + configuration.getID_HrgConfig()) : "") + " )) and mapp.taxonomyCode in (" + getStringForHql(icdValue) + ") and tnm.id = " + TaxonomyType.ICD10.getID() + (configuration.getID_HrgConfigIsNotNull() ? (" and hrgC.id<>" + configuration.getID_HrgConfig()) : "") + " )"; List<?> codes = df.find(select); if (codes == null || codes.size() == 0) return null; return (String) codes.get(0); }