qie.unescapeASTM¶
Signature: qie.unescapeASTM(value, field*, repeat*, comp*, escape*)
Returns: String unescapedValue - the unescaped value
Unescape the ASTM escaped value.
Note
'&X0D&' and '&X0A&' will be unescaped as CR ('\r') and LF ('\n').
Parameters¶
| Type | Name | Description | Default |
|---|---|---|---|
| String | value | the value to be unescaped | |
| 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 | & |
Example¶
var astmString = `
H|~^\\&|95243|HAMMO001|COMMUNITY &E& 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
L|1||3
`;
var astmMessage = qie.parseASTMString(astmString);
var companyName = astmMessage.getNode('H-5');
var companyNameUnescaped = qie.unescapeASTM(astmMessage.getNode('H-5'));