web stats
Unique NameSpace Output - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 06-10-2011, 04:31 PM
dcpbarrington dcpbarrington is offline
Mirth Newb
 
Join Date: Oct 2010
Location: Barrington IL
Posts: 17
dcpbarrington is on a distinguished road
Default Unique NameSpace Output

I'm creating a transform in Mirth to output data in CDA R2 format. Everything is fine until I need to output data that is an extension to the standard. Let me give you an example.

In the PAYER section of the CCD the data output needs to be in this format:
<participant typeCode="HLD">
<participantRole>
<id extension="SubscriberIDAsKnownToPayor" root="PayorAuthorityID"/>
<addr>
<streetAddressLine/>
<city/>
<state/>
</addr>
<telecom/>
<playingEntity>
<name>Patients Family</name>
<sdtc:birthTime nullFlavor="UNK"/>
</playingEntity>
</participantRole>
</participant>

I'm not able to get MIRTH to output the <sdtc:birthTime /> Here is what I've done.

1> defined the shell of the XML in the Outbound Message Template.
This contains:
<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:sdtc="urn:hl7-org:sdtc" >

2> I define the nameSpace variables at the start of the JavaScript and define the default namespace:

var hl7= new Namespace("urn:hl7-org:v3");
var sdtc = new Namespace("urn:hl7-org:sdtc" );
default xml namespace = hl7;

3> When I use the sdtc name space to output the birthTime I use the following javaScript code:

cda.participantRole.playingEntity.sdtc::birthTime = datestring;

4> What Mirth outputs is

xmlns:e4x_0="urn:hl7-org:sdtc"
<e4x_0:birthTime>19550302</e4x_0:birthTime>

What am I missing to get it to output <sdtc:birthTime>?
Why doesn't Mirth know that the namespace has been defined a the start of the file and redefines a new variable.

Any help would be appreciated.
Reply With Quote
  #2  
Old 06-20-2011, 10:36 AM
dcpbarrington dcpbarrington is offline
Mirth Newb
 
Join Date: Oct 2010
Location: Barrington IL
Posts: 17
dcpbarrington is on a distinguished road
Default

More Data.

I found info on the web that you should define the E4X javaScript sub-nameSpace as follows:

var sdtc:Namespace = new Namespace("urn:hl7-org:sdtc");

However when I use this format to define the nameSpace in Mirth, I get the following Error

Error on line 11: missing ; before statement


Mirth does not like the ":" in the NameSpace definition.
Any ideas?
Reply With Quote
  #3  
Old 06-20-2011, 01:14 PM
dcpbarrington dcpbarrington is offline
Mirth Newb
 
Join Date: Oct 2010
Location: Barrington IL
Posts: 17
dcpbarrington is on a distinguished road
Smile

FOUND THE ANSWER.

Looking at the E4X Specification, the function that defines a nameSpace allows you to set the name of the nameSpace.

Original Definition
var sdtc = new Namespace("urn:hl7-org:sdtc" );

Correct Definition
var sdtc = new Namespace( "sdtc", "urn:hl7-org:sdtc" );

So Simple
Reply With Quote
  #4  
Old 10-14-2011, 02:49 AM
stulugu stulugu is offline
What's HL7?
 
Join Date: Sep 2011
Posts: 3
stulugu is on a distinguished road
Default

Hi,

Could you please help me in creating channel to import CCD into SQL Server DB.

Regards,
TSridhar
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 06:55 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation