Parser parser = new GenericParser(); ValidationContext validationContext = new NoValidation(); parser.setValidationContext( validationContext );
meta.getFields( data.outputRowMeta, getStepname(), null, null, this, repository, metaStore ); data.parser = new GenericParser(); data.parser.setValidationContext( new NoValidation() );
Parser parser = new GenericParser(); ValidationContext validationContext = new NoValidation(); parser.setValidationContext( validationContext );
public synchronized GenericParser getGenericParser() { if (genericParser == null) { genericParser = new GenericParser(this); } return genericParser; }
public synchronized GenericParser getGenericParser() { if (genericParser == null) { genericParser = new GenericParser(this); } return genericParser; }
/** * Creates an instance that uses a <code>GenericParser</code>. */ @Deprecated public ApplicationRouterImpl() { this(new GenericParser()); }
/** * Creates an instance that uses a <code>GenericParser</code>. */ @Deprecated public ApplicationRouterImpl() { this(new GenericParser()); }
/** * Creates an instance that uses a <code>GenericParser</code> * @param theProcessor the <code>Processor</code> used to communicate * with the remote system */ public InitiatorImpl(Processor theProcessor) { myMetadataFields = new ArrayList<String>(20); myMetadataFields.add("MSH-18"); //add character set by default myParser = new GenericParser(); myProcessor = theProcessor; init(); }
/** * Creates an instance that uses a <code>GenericParser</code> * @param theProcessor the <code>Processor</code> used to communicate * with the remote system */ public InitiatorImpl(Processor theProcessor) { myMetadataFields = new ArrayList<String>(20); myMetadataFields.add("MSH-18"); //add character set by default myParser = new GenericParser(); myProcessor = theProcessor; init(); }
public static void main(String[] args) throws HL7Exception { String msgString = "MSH|^~\\&|RAMSOFT|SENDING FACILITY|RAMSOFT|RECEIVING FACILITY|20101223202939-0400||ADT^A08|101|P|2.3.1||||||||\r" + "EVN|A08|20101223202939-0400||||\r" + "PID||P12345^^^ISSUER|P12345^^^ISSUER||PATIENT^TEST^M^^^^||19741018|M|||10808 FOOTHILL BLVD^^RANCHO CUCAMONGA^CA^91730^US||(909)481-5872^^^sales@ramsoft.com|(909)481-5800x1||M||12345|286-50-9510|||\r" + "PV1||O||||||||||||||||||||||||||||||||||||||||||||||||||\r" + "AL1|1||^PORK^|\r" + "AL1|2||^PENICILLIN^|"; GenericParser parser = new GenericParser(); parser.setValidationContext(ValidationContextFactory.noValidation()); Message msg = parser.parse(msgString); System.out.println(msg.getClass().getName()); }
public static void main(String[] args) throws HL7Exception { String msgString = "MSH|^~\\&|RAMSOFT|SENDING FACILITY|RAMSOFT|RECEIVING FACILITY|20101223202939-0400||ADT^A08|101|P|2.3.1||||||||\r" + "EVN|A08|20101223202939-0400||||\r" + "PID||P12345^^^ISSUER|P12345^^^ISSUER||PATIENT^TEST^M^^^^||19741018|M|||10808 FOOTHILL BLVD^^RANCHO CUCAMONGA^CA^91730^US||(909)481-5872^^^sales@ramsoft.com|(909)481-5800x1||M||12345|286-50-9510|||\r" + "PV1||O||||||||||||||||||||||||||||||||||||||||||||||||||\r" + "AL1|1||^PORK^|\r" + "AL1|2||^PENICILLIN^|"; GenericParser parser = new GenericParser(); parser.setValidationContext(ValidationContextFactory.noValidation()); Message msg = parser.parse(msgString); System.out.println(msg.getClass().getName()); }
// the ANTLR grammar File f = new File("src/test/ressources/Java.g4"); // plug the ANTLR grammar in GenericParser gp = new GenericParser(f, "Java"); // load the file that we'd like to parse into a String variable String s = FileUtils.loadFileContent("src/test/ressources/HelloWorld.java"); // this listener will create an AST from the java file gp.setListener(new DefaultTreeListener()); // compile Parser/Lexer gp.compile(); ParserRuleContext ctx = ctx = gp.parse(s); // get access to AST Ast ast = dlist.getAst(); // print AST in dot format System.out.println(ast.toDot());
/** * Convenience factory method which returns an instance that has a {@link NoValidation * NoValidation validation context}. * * @return instance of GenericParser without validation */ public static GenericParser getInstanceWithNoValidation() { return new GenericParser( new DefaultHapiContext(ValidationContextFactory.noValidation())); }
/** * Convenience factory method which returns an instance that has a {@link NoValidation * NoValidation validation context}. * * @return instance of GenericParser without validation */ public static GenericParser getInstanceWithNoValidation() { return new GenericParser( new DefaultHapiContext(ValidationContextFactory.noValidation())); }
public static void main(String args[]) { if (args.length != 2) { System.out.println("Usage: DefaultValidator message_file profile_file"); System.exit(1); } DefaultValidator val = new DefaultValidator(); try { String msgString = loadFile(args[0]); Parser parser = new GenericParser(); Message message = parser.parse(msgString); String profileString = loadFile(args[1]); ProfileParser profParser = new ProfileParser(true); RuntimeProfile profile = profParser.parse(profileString); HL7Exception[] exceptions = val.validate(message, profile.getMessage()); System.out.println("Exceptions: "); for (int i = 0; i < exceptions.length; i++) { System.out.println((i + 1) + ". " + exceptions[i].getMessage()); } } catch (Exception e) { e.printStackTrace(); } }
public static void main(String args[]) { if (args.length != 2) { System.out.println("Usage: DefaultValidator message_file profile_file"); System.exit(1); } DefaultValidator val = new DefaultValidator(); try { String msgString = loadFile(args[0]); Parser parser = new GenericParser(); Message message = parser.parse(msgString); String profileString = loadFile(args[1]); ProfileParser profParser = new ProfileParser(true); RuntimeProfile profile = profParser.parse(profileString); HL7Exception[] exceptions = val.validate(message, profile.getMessage()); System.out.println("Exceptions: "); for (int i = 0; i < exceptions.length; i++) { System.out.println((i + 1) + ". " + exceptions[i].getMessage()); } } catch (Exception e) { e.printStackTrace(); } }
Parser parser = new GenericParser(); Message msg = parser.parse(hl7); Terser terser = new Terser(msg);
Parser p = new GenericParser();
+ "GT1||0222PL|NOTREAL^BOB^B||STREET^OTHER STREET^CITY^ST^77787|(444)999-3333|(222)777-5555||||MO|111-33-5555||||NOTREAL GILL N|STREET^OTHER STREET^CITY^ST^99999|(111)222-3333\r" + "IN1||022254P|4558PD|BLUE CROSS|STREET^OTHER STREET^CITY^ST^00990||(333)333-6666||221K|LENIX|||19980515|19990515|||PATIENT01 TEST D||||||||||||||||||02LL|022LP554"; Parser p = new GenericParser(); Message adt = p.parse(msg);
+ "GT1||0222PL|NOTREAL^BOB^B||STREET^OTHER STREET^CITY^ST^77787|(444)999-3333|(222)777-5555||||MO|111-33-5555||||NOTREAL GILL N|STREET^OTHER STREET^CITY^ST^99999|(111)222-3333\r" + "IN1||022254P|4558PD|BLUE CROSS|STREET^OTHER STREET^CITY^ST^00990||(333)333-6666||221K|LENIX|||19980515|19990515|||PATIENT01 TEST D||||||||||||||||||02LL|022LP554"; Parser p = new GenericParser(); Message hapiMsg = p.parse(msg);