web stats
change outbound message template value through transformer - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 10-12-2011, 05:31 AM
khan.kashif khan.kashif is offline
Mirth Newb
 
Join Date: May 2011
Posts: 10
khan.kashif is on a distinguished road
Default change outbound message template value through transformer

Dear all,

I have a CCD document template as below which I used as outbound message template but before sending to destination I want to change some value in this template with javascript transformer like

tmp['recordTarget']['patientRole']['id'] ['@extension']=msg['e_sender'].toString();

tmp['recordTarget']['patientRole']['patient']['name']['given']=msg['e_sender'].toString();

But these values are not getting replaced. can anybody suggest us what we will need to do for this?

Sample template message:

<?xml version="1.0" encoding="utf-8"?>
<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:voc="urn:hl7-org:v3/voc" xmlns:sdtc="urn:hl7-org:sdtc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:hl7-org:v3 http://xreg2.nist.gov:8080/hitspValidation/schema/cdar2c32/infrastructure/cda/C32_CDA.xsd" classCode="DOCCLIN" moodCode="EVN">
<realmCode code="US"/>
<typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040"/>
<templateId root="2.16.840.1.113883.10.20.1"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.1.1"/>
<templateId root="2.16.840.1.113883.10.20.3"/>
<templateId root="2.16.840.1.113883.3.88.11.32.1"/>
<id root="b465c926-ebc6-41f4-197b-eba2f20d7ae2"/>
<code code="34133-9" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Summarization of episode note"/>
<title>Continuity of Care Document from </title>
<effectiveTime value="201110031417-0500"/>
<confidentialityCode code="N" codeSystem="2.16.840.1.113883.5.25"/>
<languageCode code="en-US"/>
<recordTarget>
<patientRole>
<id extension="" root="2.16.840.1.113883.3.271"/>
<addr use="H">
<streetAddressLine>UNK</streetAddressLine>
<city>UNK</city>
<state>UNK</state>
<postalCode>UNK</postalCode>
<country/>
</addr>
<telecom use="HP" value="tel: UNK"/>
<patient>
<name>
<given></given>
<family></family>
<suffix/>
</name>
<administrativeGenderCode codeSystem="2.16.840.1.113883.5.1" code="F" displayName="Female"/>
<birthTime value="20110815"/>
<ethnicityCode codeSystem="2.16.840.1.113883.6.238" codeSystemName="CDC Race and Ethnicity" code="E1"/>
<raceCode codeSystem="2.16.840.1.113883.6.238" codeSystemName="CDC Race and Ethnicity" code="R3" displayName="Black or African American"/>
<languageCommunication>
<templateId root="2.16.840.1.113883.3.88.11.83.2" assigningAuthorityName="HITSP/C83"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.2.1" assigningAuthorityName="IHE/PCC"/>
<languageCode code="armenian"/>
<preferenceInd value="true"/>
</languageCommunication>
</patient>
</patientRole>
</recordTarget>
<author typeCode="AUT">
<time value="201110031417-0500"/>
<assignedAuthor classCode="ASSIGNED">
<id extension="5476" root="2.16.840.1.113883.3.271"/>
<addr use="H">
<streetAddressLine>UNK</streetAddressLine>
<city>UNK</city>
<state>UNK</state>
<postalCode>UNK</postalCode>
<country/>
</addr>
<telecom use="HP" value="tel: UNK"/>
<assignedPerson>
<name>
<given></given>
<family></family>
<suffix/>
</name>
</assignedPerson>
</assignedAuthor>
</author>
<custodian>
<assignedCustodian>
<representedCustodianOrganization>
<id extension="5476" root="2.16.840.1.113883.3.271"/>
<telecom use="HP" value="tel: UNK"/>
<addr use="H">
<streetAddressLine>UNK</streetAddressLine>
<city>UNK</city>
<state>UNK</state>
<postalCode>UNK</postalCode>
<country/>
</addr>
</representedCustodianOrganization>
</assignedCustodian>
</custodian>
<documentationOf>
<serviceEvent classCode="PCPR">
<effectiveTime>
<low value="20110916"/>
<high value="20110916"/>
</effectiveTime>
<performer typeCode="PRF">
<functionCode code="PP" codeSystem="2.16.840.1.113883.12.443" displayName="Primary Care Provider"/>
<assignedEntity>
<id extension="123456" root="1.2.3.4.5.65.88.2"/>
<assignedPerson>
<name>
<prefix>Dr.</prefix>
<given> One</given>
<family>MD</family>
</name>
</assignedPerson>
<representedOrganization>
<name>4815</name>
</representedOrganization>
</assignedEntity>
</performer>
</serviceEvent>
</documentationOf>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.1.13" assigningAuthorityName="CCD"/>
<code code="48764-5" codeSystem="2.16.840.1.113883.6.1"/>
<title>Purpose</title>
<text>Summary of patient information</text>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>
Reply With Quote
  #2  
Old 10-12-2011, 06:00 AM
Bostad Bostad is offline
Level 85 Channel Wizard
 
Join Date: Mar 2009
Location: Stratford Ontario
Posts: 712
Bostad is an unknown quantity at this point
Default

I don't see 'e_sender' in your message body, could that be the issue?
__________________
I can be reached through gmail and Google Talk using davidrothbauer at gmail dot com
http://www.linkedin.com/pub/david-rothbauer/5/923/518
codeismydrug.wordpress.com
hl7coders.wordpress.com

Test all my code suggestions prior to implementation
Reply With Quote
  #3  
Old 10-12-2011, 06:59 AM
khan.kashif khan.kashif is offline
Mirth Newb
 
Join Date: May 2011
Posts: 10
khan.kashif is on a distinguished road
Default

Actually given sample is outbound messge template where we need to update the data and it does't get changed even we write like
tmp['recordTarget']['patientRole']['id'] ['@extension']="12940";

above should replace "extension" attribute of
<id extension="" root="2.16.840.1.113883.3.271"/> in sample message template
Reply With Quote
  #4  
Old 10-12-2011, 07:10 AM
Bostad Bostad is offline
Level 85 Channel Wizard
 
Join Date: Mar 2009
Location: Stratford Ontario
Posts: 712
Bostad is an unknown quantity at this point
Default

Can you strip out any PID in your templates and attach your channel here along with a sample inbound message?

We'll have a look and see if we can figure it out.

I'm really busy today but I'll try and find the time.
__________________
I can be reached through gmail and Google Talk using davidrothbauer at gmail dot com
http://www.linkedin.com/pub/david-rothbauer/5/923/518
codeismydrug.wordpress.com
hl7coders.wordpress.com

Test all my code suggestions prior to implementation
Reply With Quote
  #5  
Old 10-12-2011, 07:35 AM
khan.kashif khan.kashif is offline
Mirth Newb
 
Join Date: May 2011
Posts: 10
khan.kashif is on a distinguished road
Default

I have attached sample channel.

what actually I want to acheive that we have a ccd document which contains sample data and we need to replace this sample value with the real one that exist in database and send this replaced ccd document to webservice destination.

I would really appriciate your involvement.
Attached Files
File Type: xml Create and Send CCD.xml (46.1 KB, 91 views)
Reply With Quote
  #6  
Old 10-12-2011, 07:40 AM
albertosaez albertosaez is offline
 
Join Date: Sep 2006
Location: Valladolid, Spain
Posts: 842
albertosaez is an unknown quantity at this point
Default

Are you setting the namespace? As CDA use the "urn:hl7-org:v3" you need:

1) Be sure to un-check the "strip namespace" of the outbound template:
2) Set the following line before any map code (note than you need to recover msg variables before setting the default namespace to HL7V3 as otherwise you couldn't get msg values. This is usual when msg and tmp are from different namespace:


Code:
var e_sender=msg['e_sender'].toString();

default xml namespace="urn:hl7-org:v3";

tmp['recordTarget']['patientRole']['id'] ['@extension']=e_sender;
tmp['recordTarget']['patientRole']['patient']['name']['given']=e_sender;
Reply With Quote
  #7  
Old 10-13-2011, 01:15 AM
khan.kashif khan.kashif is offline
Mirth Newb
 
Join Date: May 2011
Posts: 10
khan.kashif is on a distinguished road
Default

Thanks a lot dear, your suggestion worked for me
Reply With Quote
  #8  
Old 10-14-2011, 02:42 AM
stulugu stulugu is offline
What's HL7?
 
Join Date: Sep 2011
Posts: 3
stulugu is on a distinguished road
Default

Hi Kashif,

I need to work on inbound CCD to SQL DB. could you please help me in creating this channel.

Regards,
T Sridhar
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 11:53 AM.


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