software/browser-util/src/gov/nih/nci/evs/browser/utils/PropertyData.java
//[NCITERM-746] Update of the Relationships Display.

[NCITERM-746] Update of the Relationships Display.
[ NCITERM - 746 ] Update of the Relationships Display .
public String generateRelationshipTable(String codingScheme, String version, String code, String namespace, String rel_type, boolean display_qualifiers) {
        boolean display_equiv_expression = false;
        String equivalanceClass = null;
        if (isNCIT(codingScheme) && rel_type.compareTo(Constants.TYPE_ROLE) == 0) {
			try {
				equivalanceClass = new CodingSchemeDataUtils(lbSvc).getEquivalenceExpression(codingScheme, version, code, namespace);
				if (equivalanceClass != null) {
					display_equiv_expression = true;
				}
		    } catch (Exception ex) {
				ex.printStackTrace();
			}
		}
		/*
        if (isNCIT(codingScheme) && rel_type.compareTo(Constants.TYPE_ROLE) == 0) {
			try {
				equivalanceClass = new CodingSchemeDataUtils(lbSvc).getEquivalenceExpression(codingScheme, version, code, namespace);
				if (equivalanceClass != null) {
					display_equiv_expression = true;
				} else {
					return "";
				}
		    } catch (Exception ex) {
				ex.printStackTrace();
			}
		}
		*/
		StringBuffer buf = new StringBuffer();
		if (display_equiv_expression) {
			String expression = new ExpressionParser(lbSvc).infixExpression2Text(codingScheme, version, equivalanceClass);
			if (expression != null) {
				expression = new ExpressionFormatter(lbSvc).reformat(expression);
				buf.append(expression);
			}
		}
		if (isNCIT(codingScheme) && rel_type.compareTo(Constants.TYPE_ROLE) == 0) {
			ArrayList roles = null;
			String formattedTable = null;
			if (relationshipHashMap != null) {
				roles = (ArrayList) relationshipHashMap.get(Constants.TYPE_ROLE);
				formattedTable = formatter.formatOutboundRoleTable(roles);
			} else {
			    formattedTable = formatter.formatOutboundRoleTable(codingScheme, version, code, codingScheme);
			}
			buf.append("<p></p>");
			buf.append(formattedTable);
			buf.append("<p></p>");
			return buf.toString();
		} else if (isNCIT(codingScheme) && rel_type.compareTo(Constants.TYPE_INVERSE_ROLE) == 0) {
			ArrayList roles = null;
			String formattedTable = null;
			if (relationshipHashMap != null) {
				roles = (ArrayList) relationshipHashMap.get(Constants.TYPE_INVERSE_ROLE);
				formattedTable = formatter.formatInboundRoleTable(roles);
			} else {
			    formattedTable = formatter.formatInboundRoleTable(codingScheme, version, code, codingScheme);
			}
			buf.append("<p></p>");
			buf.append(formattedTable);
			buf.append("<p></p>");
			return buf.toString();
		}
		return generateRelationshipTable(codingScheme, version, code, namespace, rel_type, display_qualifiers, null);
	}
public String generateRelationshipTable ( String codingScheme , String version , String code , String namespace , String rel_type , boolean display_qualifiers ) { boolean display_equiv_expression = false ; String equivalanceClass = null ; if ( isNCIT ( codingScheme ) && rel_type . compareTo ( Constants . TYPE_ROLE ) == 0 ) { try { equivalanceClass = new CodingSchemeDataUtils ( lbSvc ) . getEquivalenceExpression ( codingScheme , version , code , namespace ) ; if ( equivalanceClass != null ) { display_equiv_expression = true ; } } catch ( Exception ex ) { ex . printStackTrace ( ) ; } } /*
        if (isNCIT(codingScheme) && rel_type.compareTo(Constants.TYPE_ROLE) == 0) {
			try {
				equivalanceClass = new CodingSchemeDataUtils(lbSvc).getEquivalenceExpression(codingScheme, version, code, namespace);
				if (equivalanceClass != null) {
					display_equiv_expression = true;
				} else {
					return "";
				}
		    } catch (Exception ex) {
				ex.printStackTrace();
			}
		}
		*/ StringBuffer buf = new StringBuffer ( ) ; if ( display_equiv_expression ) { String expression = new ExpressionParser ( lbSvc ) . infixExpression2Text ( codingScheme , version , equivalanceClass ) ; if ( expression != null ) { expression = new ExpressionFormatter ( lbSvc ) . reformat ( expression ) ; buf . append ( expression ) ; } } if ( isNCIT ( codingScheme ) && rel_type . compareTo ( Constants . TYPE_ROLE ) == 0 ) { ArrayList roles = null ; String formattedTable = null ; if ( relationshipHashMap != null ) { roles = ( ArrayList ) relationshipHashMap . get ( Constants . TYPE_ROLE ) ; formattedTable = formatter . formatOutboundRoleTable ( roles ) ; } else { formattedTable = formatter . formatOutboundRoleTable ( codingScheme , version , code , codingScheme ) ; } buf . append ( "<p></p>" ) ; buf . append ( formattedTable ) ; buf . append ( "<p></p>" ) ; return buf . toString ( ) ; } else if ( isNCIT ( codingScheme ) && rel_type . compareTo ( Constants . TYPE_INVERSE_ROLE ) == 0 ) { ArrayList roles = null ; String formattedTable = null ; if ( relationshipHashMap != null ) { roles = ( ArrayList ) relationshipHashMap . get ( Constants . TYPE_INVERSE_ROLE ) ; formattedTable = formatter . formatInboundRoleTable ( roles ) ; } else { formattedTable = formatter . formatInboundRoleTable ( codingScheme , version , code , codingScheme ) ; } buf . append ( "<p></p>" ) ; buf . append ( formattedTable ) ; buf . append ( "<p></p>" ) ; return buf . toString ( ) ; } return generateRelationshipTable ( codingScheme , version , code , namespace , rel_type , display_qualifiers , null ) ; }
[NCITERM-746] Update of the Relationships Display.
[ NCITERM - 746 ] Update of the Relationships Display .