web stats
Delete segment xml - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 12-02-2019, 08:24 AM
mberges mberges is offline
OBX.1 Kenobi
 
Join Date: Jan 2018
Posts: 44
mberges is on a distinguished road
Default Delete segment xml

Good. Could someone tell me how I can delete the SPM segment of this message in XML format?

<OUL_R24.SPECIMEN>
<SPM>
<SPM.1>1</SPM.1>
<SPM.2>
<EIP.1>
<EI.1></EI.1>
</EIP.1>
<EIP.2>
<EI.1></EI.1>
</EIP.2>
</SPM.2>
<SPM.4>
<CWE.1</CWE.1>
</SPM.4>
<SPM.18>
<TS.1></TS.1>
</SPM.18>
<SPM.20>Y</SPM.20>
</SPM>
<OBX>
<OBX.1>1</OBX.1>
<OBX.2>NM</OBX.2>
<OBX.3>
<CE.1>EC</CE.1>
<CE.2></CE.2>
<CE.3>LN</CE.3>
</OBX.3>
<OBX.6>
<CE.1>seg</CE.1>
</OBX.6>
<OBX.7></OBX.7>
<OBX.8>N</OBX.8>
<OBX.11>I</OBX.11>
</OBX>
<OBX>
<OBX.1>2</OBX.1>
<OBX.2>NM</OBX.2>
<OBX.3>
<CE.1></CE.1>
<CE.2></CE.2>
<CE.3>LN</CE.3>
</OBX.3>
<OBX.6>
<CE.1>seg</CE.1>
</OBX.6>
<OBX.7></OBX.7>
<OBX.8>N</OBX.8>
<OBX.11>D</OBX.11>
<OBX.14>
<TS.1>20190408171238</TS.1>
</OBX.14>
</OBX>
</OUL_R24.SPECIMEN>
Reply With Quote
  #2  
Old 12-02-2019, 08:36 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,347
cory_cole is on a distinguished road
Default

delete msg['SPM']
Reply With Quote
  #3  
Old 12-02-2019, 08:37 AM
kirbykn2's Avatar
kirbykn2 kirbykn2 is offline
Mirth Guru
 
Join Date: Sep 2014
Location: Michigan
Posts: 607
kirbykn2 is on a distinguished road
Default

delete msg['SPM']
__________________
Best,

Kirby

Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

Appliance Version 3.11.4
Mirth Connect Version 3.8.0
Java Version 1.6.0_45-b06
Java (64 bit) Version 1.6.0_45-b06
Java 7 (64 bit) Version 1.7.0_151-b15
Java 8 (64 bit) Version 1.8.0_181-b13
PostgreSQL Version 9.6.8
Reply With Quote
  #4  
Old 12-02-2019, 08:39 AM
mberges mberges is offline
OBX.1 Kenobi
 
Join Date: Jan 2018
Posts: 44
mberges is on a distinguished road
Default

It doesn't work for me
Reply With Quote
  #5  
Old 12-02-2019, 08:44 AM
kirbykn2's Avatar
kirbykn2 kirbykn2 is offline
Mirth Guru
 
Join Date: Sep 2014
Location: Michigan
Posts: 607
kirbykn2 is on a distinguished road
Default

Can you tell us why it doesn't work? Do you receive an error?

Perhaps the message isn't HL7? I thought you were posting the xml transformed step, but maybe your message is XML?
__________________
Best,

Kirby

Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

Appliance Version 3.11.4
Mirth Connect Version 3.8.0
Java Version 1.6.0_45-b06
Java (64 bit) Version 1.6.0_45-b06
Java 7 (64 bit) Version 1.7.0_151-b15
Java 8 (64 bit) Version 1.8.0_181-b13
PostgreSQL Version 9.6.8
Reply With Quote
  #6  
Old 12-02-2019, 08:56 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,347
cory_cole is on a distinguished road
Default

try this....

msg = delete msg['SPM'];
Reply With Quote
  #7  
Old 12-02-2019, 09:16 AM
mberges mberges is offline
OBX.1 Kenobi
 
Join Date: Jan 2018
Posts: 44
mberges is on a distinguished road
Default

I receive the message in xml format
Reply With Quote
  #8  
Old 12-02-2019, 10:05 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 1,106
agermano is on a distinguished road
Default

delete msg['SPM'] worked for me after I fixed the typo (CWE.1 is missing the >.)

Kirby asked if you were getting an error. What else is your transformer doing? Are you using an outbound template?
Reply With Quote
  #9  
Old 12-02-2019, 10:08 AM
mberges mberges is offline
OBX.1 Kenobi
 
Join Date: Jan 2018
Posts: 44
mberges is on a distinguished road
Default

I am using this transformer. I managed to delete the first segment, but I can't get the rest of the message deleted

var con = 0;
for each( spm in msg['OUL_R24.ORDER'][con]['OUL_R24.SPECIMEN']){

delete spm['SPM'][con];
con++;
}
Reply With Quote
  #10  
Old 12-02-2019, 11:39 AM
mberges mberges is offline
OBX.1 Kenobi
 
Join Date: Jan 2018
Posts: 44
mberges is on a distinguished road
Default

I have already solved. Thank you
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 02:44 AM.


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