IPWorks EDI 2020 Node.js Edition

Questions / Feedback?

UseSchemaName Property

Whether the output XML uses element names based on name defined in the schema.

Syntax

 hl7translator.getUseSchemaName([callback])
 hl7translator.setUseSchemaName( useSchemaName, [callback])

Default Value

FALSE

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for the getUseSchemaName([callback]) method is defined as:

function(err, data){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'data' is the value returned by the method.

The callback for the setUseSchemaName([callback]) method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

This setting specifies whether the XML element name written to output is taken from the Id of the element defined in the schema. It is only applicable to ArcESB JSON schemas. For instance, given an X12 document with the segment:

N1*BY*Apple Inc.*92*544380~

When this setting is True the XML generated may look like:

<N1Loop1 type="Loop">
<N1 type="Segment">
<_98 desc="Entity Identifier Code_98">BY</_98>
<_93 desc="Name_93">Apple Inc.</_93>
<_66 desc="Identification Code Qualifier_66">92</_66>
<_67 desc="Identification Code_67">544380</_67>
</N1>

Where the elements "_98", "_93", etc. are taken from the Id values of the EDI elements in the schema files.

Note: In order to produce valid XML, elements that would begin with a digit are prefixed with the "_" character.

In contrast if False (default) the XML generated may look like:

<N1Loop1 type="Loop">
<N1 type="Segment" desc="Name">
<N101 desc="Entity Identifier Code_98">BY</N101>
<N102 desc="Name_93">Apple Inc.</N102>
<N103 desc="Identification Code Qualifier_66">92</N103>
<N104 desc="Identification Code_67">544380</N104>
</N1>
The default value is False. This setting is only applicable when using ArcESB JSON schemas.

Data Type

Boolean

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks EDI 2020 Node.js Edition - Version 20.0 [Build 8203]