Search in sources :

Example 21 with Element

use of org.talend.designer.hl7.ui.data.Element in project tdi-studio-se by Talend.

the class HL7OutputManager method getRootTable.

public List<Map<String, String>> getRootTable() {
    List<Map<String, String>> result = new ArrayList<Map<String, String>>();
    for (HL7TreeNode rootNode : this.getOriginalNodes()) {
        // if (!(rootNode instanceof HL7Root)) {
        initNodeOrder(rootNode);
        order = 1;
        // }
        //$NON-NLS-1$
        tableLoader((Element) rootNode, "", result, rootNode.getDefaultValue());
    }
    return result;
}
Also used : ArrayList(java.util.ArrayList) HL7TreeNode(org.talend.designer.hl7.ui.data.HL7TreeNode) HashMap(java.util.HashMap) Map(java.util.Map)

Example 22 with Element

use of org.talend.designer.hl7.ui.data.Element in project tdi-studio-se by Talend.

the class HL7OutputManager method getLoopTable.

public List<Map<String, String>> getLoopTable() {
    List<Map<String, String>> result = new ArrayList<Map<String, String>>();
    for (HL7TreeNode rootNode : this.getOriginalNodes()) {
        Element loopNode = (Element) getLoopNode(rootNode);
        if (loopNode != null) {
            String path = getPath(loopNode);
            //$NON-NLS-1$
            tableLoader(loopNode, path.substring(0, path.lastIndexOf("/")), result, loopNode.getDefaultValue());
        }
    }
    return result;
}
Also used : Element(org.talend.designer.hl7.ui.data.Element) ArrayList(java.util.ArrayList) HL7TreeNode(org.talend.designer.hl7.ui.data.HL7TreeNode) HashMap(java.util.HashMap) Map(java.util.Map)

Example 23 with Element

use of org.talend.designer.hl7.ui.data.Element in project tdi-studio-se by Talend.

the class UIManager method autoMap.

/**
     * 
     * DOC xzhang Comment method "autoMap".
     */
public void autoMap(String currentSchema) {
    if (this.hl7Manager instanceof HL7OutputManager) {
        List<HL7TreeNode> roots = this.hl7Manager.getTreeData("");
        List<HL7TreeNode> mappableNodes = new ArrayList<HL7TreeNode>();
        for (HL7TreeNode root : roots) {
            getMappableNode((Element) root, mappableNodes);
        }
        List<IMetadataColumn> schemaData = this.hl7Manager.getSchemaData(currentSchema);
        for (HL7TreeNode node : mappableNodes) {
            for (IMetadataColumn column : schemaData) {
                if (node.getLabel().equals(column.getLabel())) {
                    node.setDefaultValue(null);
                    node.setColumn(column);
                    break;
                }
            // String[] splits = node.getColumnLabel().split(":");
            // for (String s : splits) {
            // if (s.equals(column.getLabel())) {
            // node.setDefaultValue(null);
            // node.setColumn(column);
            // break;
            // }
            // }
            }
        }
        // this.hl7UI.refreshXMLViewer(root);
        this.hl7UI.redrawLinkers();
        return;
    }
    this.hl7UI.autoMap();
}
Also used : ArrayList(java.util.ArrayList) HL7TreeNode(org.talend.designer.hl7.ui.data.HL7TreeNode) IMetadataColumn(org.talend.core.model.metadata.IMetadataColumn)

Aggregations

HL7TreeNode (org.talend.designer.hl7.ui.data.HL7TreeNode)20 Element (org.talend.designer.hl7.ui.data.Element)13 ArrayList (java.util.ArrayList)8 HashMap (java.util.HashMap)6 Map (java.util.Map)4 Group (ca.uhn.hl7v2.model.Group)3 List (java.util.List)3 IMetadataTable (org.talend.core.model.metadata.IMetadataTable)3 HL7FileNode (org.talend.core.model.metadata.builder.connection.HL7FileNode)3 Message (ca.uhn.hl7v2.model.Message)2 GridData (org.eclipse.swt.layout.GridData)2 TreeItem (org.eclipse.swt.widgets.TreeItem)2 IMetadataColumn (org.talend.core.model.metadata.IMetadataColumn)2 IConnection (org.talend.core.model.process.IConnection)2 HL7OutputManager (org.talend.designer.hl7.managers.HL7OutputManager)2 SegmentModel (org.talend.designer.hl7.model.SegmentModel)2 Structure (ca.uhn.hl7v2.model.Structure)1 Type (ca.uhn.hl7v2.model.Type)1 EList (org.eclipse.emf.common.util.EList)1 Command (org.eclipse.gef.commands.Command)1