Mirth Community

Mirth Community (http://www.mirthcorp.com/community/forums/index.php)
-   Support (http://www.mirthcorp.com/community/forums/forumdisplay.php?f=6)
-   -   change outbound message template value through transformer (http://www.mirthcorp.com/community/forums/showthread.php?t=6105)

khan.kashif 10-12-2011 05:31 AM

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>

Bostad 10-12-2011 06:00 AM

I don't see 'e_sender' in your message body, could that be the issue?

khan.kashif 10-12-2011 06:59 AM

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

Bostad 10-12-2011 07:10 AM

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.

khan.kashif 10-12-2011 07:35 AM

1 Attachment(s)
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.

albertosaez 10-12-2011 07:40 AM

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;


khan.kashif 10-13-2011 01:15 AM

Thanks a lot dear, your suggestion worked for me

stulugu 10-14-2011 02:42 AM

Hi Kashif,

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

Regards,
T Sridhar


All times are GMT -8. The time now is 07:13 AM.

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