Loading histream-i2b2/src/main/java/de/sekmi/histream/i2b2/ont/Import.java +12 −14 Original line number Diff line number Diff line Loading @@ -245,6 +245,9 @@ public class Import implements AutoCloseable{ insertModifierCount ++; } private String generateMetadataXML(ValueRestriction vr) throws XMLStreamException, OntologyException{ if( vr == null ){ return null; } StringWriter xmlbuf = new StringWriter(); XMLOutputFactory xmlout = XMLOutputFactory.newInstance(); XMLStreamWriter xml = xmlout.createXMLStreamWriter(xmlbuf); Loading Loading @@ -452,20 +455,11 @@ public class Import implements AutoCloseable{ // c_metadataxml ValueRestriction vr = concept.getValueRestriction(); if( vr == null ){ insertMeta.setString(7, null); }else{ // build metadata xml // set value try { insertMeta.setString(7, generateMetadataXML(vr)); insertMeta.setString(7, generateMetadataXML(concept.getValueRestriction())); } catch (XMLStreamException e) { // TODO log error e.printStackTrace(); insertMeta.setString(7, null); } throw new OntologyException("Failed to generate metadata XML for concept "+concept.getID(), e); } // c_dimcode (with concept_dimension.concept_path LIKE) Loading Loading @@ -546,7 +540,11 @@ public class Import implements AutoCloseable{ // c_basecode insertMetaModifier.setString(6, ids[0]); // c_metadataxml insertMetaModifier.setString(7, null); try { insertMetaModifier.setString(7, generateMetadataXML(modifier.getValueRestriction())); } catch (XMLStreamException e) { throw new OntologyException("Failed to generate metadata XML for modifier "+modifier.getID(), e); } // c_dimcode insertMetaModifier.setString(8, label); // c_tooltip Loading Loading
histream-i2b2/src/main/java/de/sekmi/histream/i2b2/ont/Import.java +12 −14 Original line number Diff line number Diff line Loading @@ -245,6 +245,9 @@ public class Import implements AutoCloseable{ insertModifierCount ++; } private String generateMetadataXML(ValueRestriction vr) throws XMLStreamException, OntologyException{ if( vr == null ){ return null; } StringWriter xmlbuf = new StringWriter(); XMLOutputFactory xmlout = XMLOutputFactory.newInstance(); XMLStreamWriter xml = xmlout.createXMLStreamWriter(xmlbuf); Loading Loading @@ -452,20 +455,11 @@ public class Import implements AutoCloseable{ // c_metadataxml ValueRestriction vr = concept.getValueRestriction(); if( vr == null ){ insertMeta.setString(7, null); }else{ // build metadata xml // set value try { insertMeta.setString(7, generateMetadataXML(vr)); insertMeta.setString(7, generateMetadataXML(concept.getValueRestriction())); } catch (XMLStreamException e) { // TODO log error e.printStackTrace(); insertMeta.setString(7, null); } throw new OntologyException("Failed to generate metadata XML for concept "+concept.getID(), e); } // c_dimcode (with concept_dimension.concept_path LIKE) Loading Loading @@ -546,7 +540,11 @@ public class Import implements AutoCloseable{ // c_basecode insertMetaModifier.setString(6, ids[0]); // c_metadataxml insertMetaModifier.setString(7, null); try { insertMetaModifier.setString(7, generateMetadataXML(modifier.getValueRestriction())); } catch (XMLStreamException e) { throw new OntologyException("Failed to generate metadata XML for modifier "+modifier.getID(), e); } // c_dimcode insertMetaModifier.setString(8, label); // c_tooltip Loading