Skip to content

qie.parseASTMString

Signature: qie.parseASTMString(value, field*, repeat*, comp*, escape*, encoding*)

Returns: ASTM Message astmMessage - the associated ASTM message object

Parse the input string as ASTM and return the associated message object.

Note

The return value CAN NEVER be assigned to the bound-in message object; it should be assigned to a locally declared variable.

Parameters

Type Name Description Default
String value the source string to be parsed
String field* (optional) the ASTM field delimiter character |
String repeat* (optional) the ASTM field value repeat character \
String comp* (optional) the ASTM field component delimiter character ^
String escape* (optional) the ASTM escape character &
String encoding* (optional) the character encoding for this message Source Node encoding

Example

var astmString = `
H|~^\\&|95243|HAMMO001|COMMUNITY AND FAMILY MEDICINE|BOX 2914^DUKE UNIVERSITY MEDICAL CENTER^DURHAM^NC|919-684-6721|THIS IS A TEST TO SEE IF WE CAN MAKE THIS BREAK INTO ANOTHER SEGMENT|SMITHKLINE CLINICAL LABS|
A|TEST MESSAGE|D|2|199401170932
P|1|999-99-9999|||GUNCH^MODINE^SUE|00279~1&2&3&4^00998~2&3&4&5^00998~3&4&5&6|19430704|F|RT 1, BOX 97^ZIRCONIA^NC^27401||704-982-1234||DOCTOR^PRIMARY^A^^DR.
O|1|101||80018^CHEM 18|R||||N|||||MD&PRIMARY&A&DR.
O|2|102||85025^AUTO CBC|R||||N|||||MD&PRIMARY&A&DR.H
P|2|999-99-9998|||GUNCH^^JOHN|00281~1&2&3&3^00996~2&3&5&5^00996~3&4&6&6|19410228|M|RT 1, BOX 97^ZIRCONIA^NC^27401||704-982-1234||DOCTOR^PRIMARY^A^^DR.
O|1|101||80018^CHEM 19|R||||N|||||MD&PRIMARY&A&DR.
O|2|102||85025^AUTO CBD|R||||N|||||MD&PRIMARY&A&DR.H
P|3|999-99-9997|||GUNCH^TEST^JANE|00280~1&2&4&4^00997~2&3&4&4^00997~3&4&5&5|19930305|F|RT 1, BOX 97^ZIRCONIA^NC^27401||704-982-1234||DOCTOR^PRIMARY^A^^DR.
O|1|101||80018^CHEM 20|R||||N|||||MD&PRIMARY&A&DR.
O|2|102||85025^AUTO CBE|R||||N|||||MD&PRIMARY&A&DR.H
R|1|ST|||eCW Encounter: Limb pain1|||||||||20100607113000|||
R|2|ST|||eCW Encounter: Limb pain2 More|Next||||||||20100607113000|||
R|3|ST|||eCW Encounter: Limb pain3|||||||||20100607113000|||
L|1||3
`;
var astmMessage = qie.parseASTMString(astmString);