|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.uhn.hl7v2.parser.Parser
ca.uhn.hl7v2.parser.FastParser
public class FastParser
This class has been deprecated and should not be used. PipeParser has been optimized and is now roughly 20% faster than FastParser (see FastParserTest for a test of this)
| Nested Class Summary | |
|---|---|
static class |
FastParser.RootRef
Deprecated. A convenience StructRef that points to a message root. |
static class |
FastParser.StructRef
Deprecated. A pointer to a distinct segment or group position in a message. |
| Constructor Summary | |
|---|---|
FastParser(Map<Object,FastParser.StructRef> theEventGuideMap)
Deprecated. |
|
FastParser(ModelClassFactory theFactory,
Map<Object,FastParser.StructRef> theEventGuideMap)
Deprecated. |
|
| Method Summary | |
|---|---|
protected String |
doEncode(Message source)
Deprecated. Called by encode(Message) to perform implementation-specific encoding work. |
protected String |
doEncode(Message source,
String encoding)
Deprecated. Called by encode(Message, String) to perform implementation-specific encoding work. |
String |
doEncode(Segment structure,
EncodingCharacters encodingCharacters)
Deprecated. Not supported, throws UnsupportedOperationException |
String |
doEncode(Type type,
EncodingCharacters encodingCharacters)
Deprecated. Not supported, throws UnsupportedOperationException |
protected Message |
doParse(String message,
String version)
Deprecated. Called by parse() to perform implementation-specific parsing work. |
protected Message |
doParseForSpecificPackage(String theMessage,
String theVersion,
String thePackageName)
Deprecated. Throws unsupported operation exception |
String |
getAckID(String message)
Deprecated. For response messages, returns the value of MSA-2 (the message ID of the message sent by the sending system). |
Segment |
getCriticalResponseData(String message)
Deprecated. Returns a minimal amount of data from a message string, including only the data needed to send a response to the remote system. |
String |
getDefaultEncoding()
Deprecated. |
String |
getEncoding(String message)
Deprecated. Returns a String representing the encoding of the given message, if the encoding is recognized. |
String |
getVersion(String message)
Deprecated. Returns the version ID (MSH-12) from the given message, without fully parsing the message. |
static Map<Object,FastParser.StructRef> |
loadEventGuideMap(URL theMapURL)
Deprecated. Loads a parsing guide map (as required for FastParser instantiation). |
void |
parse(Message message,
String string)
Deprecated. Not supported, throws UnsupportedOperationException |
void |
parse(Segment segment,
String string,
EncodingCharacters encodingCharacters)
Deprecated. Not supported, throws UnsupportedOperationException |
void |
parse(Type type,
String string,
EncodingCharacters encodingCharacters)
Deprecated. Not supported, throws UnsupportedOperationException |
boolean |
supportsEncoding(String encoding)
Deprecated. Returns true if and only if the given encoding is supported by this Parser. |
| Methods inherited from class ca.uhn.hl7v2.parser.Parser |
|---|
encode, encode, getFactory, getMessageStructureForEvent, getMessageStructures, getParserConfiguration, getValidationContext, instantiateMessage, instantiateMessageInASpecificPackage, makeControlMSH, parse, parseForSpecificPackage, setParserConfiguration, setValidationContext, validVersion |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FastParser(Map<Object,FastParser.StructRef> theEventGuideMap)
theEventGuideMap - a map with keys in the form "type^event" (like MSH-9
components 1 and 2). Values are corresponding parsing guides for those events.
A parsing guide is a group of StructRef that identify which segments to parse,
the relationships between them, and where to find them in a message hierarchy.
The value in the map is the RootRef of the message root. It must return the
StructRef for the MSH segment from getSuccessor("MSH"). References to other
segments can be included as needed.
public FastParser(ModelClassFactory theFactory,
Map<Object,FastParser.StructRef> theEventGuideMap)
theFactory - custom factory to use for model class lookuptheEventGuideMap - a map with keys in the form "type^event" (like MSH-9
components 1 and 2). Values are corresponding parsing guides for those events.
A parsing guide is a group of StructRef that identify which segments to parse,
the relationships between them, and where to find them in a message hierarchy.
The value in the map is the RootRef of the message root. It must return the
StructRef for the MSH segment from getSuccessor("MSH"). References to other
segments can be included as needed.| Method Detail |
|---|
public static Map<Object,FastParser.StructRef> loadEventGuideMap(URL theMapURL)
throws HL7Exception
theMapURL - an URL to a file of the form desribed above
HL7Exceptionpublic String getEncoding(String message)
Parser
getEncoding in class ParserParser.getEncoding(java.lang.String)public boolean supportsEncoding(String encoding)
Parser
supportsEncoding in class ParserParser.supportsEncoding(java.lang.String)public String getDefaultEncoding()
getDefaultEncoding in class Parser
protected Message doParse(String message,
String version)
throws HL7Exception,
EncodingNotSupportedException
Parser
doParse in class Parsermessage - a String that contains an HL7 messageversion - the name of the HL7 version to which the message belongs (eg "2.5")
HL7Exception - if the message is not correctly formatted.
EncodingNotSupportedException - if the message encoded
is not supported by this parser.Parser.doParse(java.lang.String, java.lang.String)
protected String doEncode(Message source,
String encoding)
throws HL7Exception,
EncodingNotSupportedException
Parser
doEncode in class Parsersource - a Message object from which to construct an encoded message stringencoding - the name of the HL7 encoding to use (eg "XML"; most implementations support only
one encoding)
HL7Exception - if the data fields in the message do not permit encoding
(e.g. required fields are null)
EncodingNotSupportedException - if the requested encoding is not
supported by this parser.Parser.encode(ca.uhn.hl7v2.model.Message, java.lang.String)
protected String doEncode(Message source)
throws HL7Exception
Parser
doEncode in class Parsersource - a Message object from which to construct an encoded message string
HL7Exception - if the data fields in the message do not permit encoding
(e.g. required fields are null)
EncodingNotSupportedException - if the requested encoding is not
supported by this parser.Parser.encode(ca.uhn.hl7v2.model.Message)
public Segment getCriticalResponseData(String message)
throws HL7Exception
ParserReturns a minimal amount of data from a message string, including only the data needed to send a response to the remote system. This includes the following fields:
getCriticalResponseData in class ParserHL7ExceptionParser.getCriticalResponseData(java.lang.String)public String getAckID(String message)
Parser
getAckID in class ParserParser.getAckID(java.lang.String)
public String getVersion(String message)
throws HL7Exception
Parser
getVersion in class ParserHL7Exception - if the version field can not be found.Parser.getVersion(java.lang.String)
public String doEncode(Segment structure,
EncodingCharacters encodingCharacters)
throws HL7Exception
doEncode in class Parserstructure - The structure to encodeencodingCharacters - The encoding characters
UnsupportedOperationException
HL7Exception - If there is a problem encoding
public String doEncode(Type type,
EncodingCharacters encodingCharacters)
throws HL7Exception
doEncode in class Parsertype - The type to encodeencodingCharacters - The encoding characters
UnsupportedOperationException
HL7Exception - If there is a problem encoding
public void parse(Type type,
String string,
EncodingCharacters encodingCharacters)
throws HL7Exception
parse in class Parsertype - The type to encodestring - The string to parseencodingCharacters - The encoding characters
UnsupportedOperationException
HL7Exception - If there is a problem encoding
public void parse(Segment segment,
String string,
EncodingCharacters encodingCharacters)
throws HL7Exception
parse in class Parsersegment - The segment to encodestring - The string to parseencodingCharacters - The encoding characters
UnsupportedOperationException
HL7Exception - If there is a problem encoding
public void parse(Message message,
String string)
throws HL7Exception
parse in class Parsermessage - The message to encodestring - The string to parse
UnsupportedOperationException
HL7Exception - If there is a problem encoding
protected Message doParseForSpecificPackage(String theMessage,
String theVersion,
String thePackageName)
throws HL7Exception,
EncodingNotSupportedException
doParseForSpecificPackage in class ParserUnsupported - operation exception
HL7Exception
EncodingNotSupportedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||