web stats
OBX NTE segment pairing - Page 3 - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #21  
Old 10-02-2012, 04:09 AM
dobunzli dobunzli is offline
OBX.1 Kenobi
 
Join Date: Jun 2010
Posts: 48
dobunzli is on a distinguished road
Default

Hello all
Found the culprit. Problem was effectively a symbol --> the ' in "d'une"
So adding
lab_comments = lab_comments.replace (/\'/g, " ");
did the trick.
Reply With Quote
  #22  
Old 10-03-2012, 09:21 AM
MPrecup MPrecup is offline
OBX.1 Kenobi
 
Join Date: Jun 2012
Posts: 30
MPrecup is on a distinguished road
Default

If anyone was wondering about doblunzi's first error, it's because he was using an older package. Changing it to

Packages.com.mirth.connect.server.controllers.Chan nelController.getInstance();

should fix the problem.

Last edited by MPrecup; 10-03-2012 at 09:26 AM.
Reply With Quote
  #23  
Old 03-08-2013, 10:38 AM
Anirudh Anirudh is offline
OBX.3 Kenobi
 
Join Date: Sep 2012
Posts: 135
Anirudh is on a distinguished road
Default

Quote:
Originally Posted by albertosaez View Post
As the name of the XML fields has "." in their names, I would suggest another aproach:

Code:
var maxObs=msg['ORU_R01.PATIENT_RESULT']['ORU_R01.ORDER_OBSERVATION']['ORU_R01.OBSERVATION'].length();

for( var obsi=0;obsi<maxObs;obsi++){
       var  observation =msg['ORU_R01.PATIENT_RESULT']['ORU_R01.ORDER_OBSERVATION']['ORU_R01.OBSERVATION'][obsi];
	var lab_name = observation['OBX']['OBX.3']['CE.2'].toString();
        var coments="":
        for each (nte in observation..NTE) {
              coments+=nte['NTE.3'].toString();
        }
How to loop multiple values..Sorry for bothering guys I already posted my code in multiple OBR and OBX's..Some how the loop is not working..Can someone please help me out.
Reply With Quote
  #24  
Old 08-19-2015, 04:24 AM
yacine1991 yacine1991 is offline
What's HL7?
 
Join Date: Jul 2015
Posts: 1
yacine1991 is on a distinguished road
Default Try this

I had the same pb.
Try this to link then using unique fields :

Code:
/* Arguments
	---------
		Required
		--------
			root:			The root HL7Message node of the message, or the parent of the segment node.
			childSegment:		The child segment to add the link with specific field form parent.
			parentSegment:		The parent segment you want to link.
           	parentFieldToLink:  The specific field from the parent you want to use as a link
*/
function linkToParentNode(root, childSegment, parentSegment, parentFieldToLink) {
    var rootLength = root.children().length();
    var parentIndex = 0;
    var parentInnerIndex = 0;
    var childIndex = 0;
    var wantedNodeValue;
    var parentLength = 0;
    var parentValue = <parentValue/>;
    var parentName = <parentName/>;



    while (parentIndex < rootLength) {
        // If segement is a parent
        if (root.children()[parentIndex].name().toString() == parentSegment.toString()) {
            parentLength = root.children()[parentIndex].children().length();
            while (parentInnerIndex < parentLength) {
                if (root.children()[parentIndex].children().children()[parentInnerIndex].name().toString() == parentFieldToLink.toString()) {
                    wantedNodeValue = root.children()[parentIndex].children().children()[parentInnerIndex].toString();

                    break;
                } else {
                    parentInnerIndex++;
                }
            }
            childIndex = parentIndex + 1;
        while (childIndex < rootLength && root.children()[childIndex].name().toString() != parentSegment.toString()) {
            if (root.children()[childIndex].name().toString() == childSegment.toString()) {
                parentValue['parentValue.1'] = wantedNodeValue;
                parentName['parentName.1'] = parentSegment;
                root.children()[childIndex].children()[root.children()[childIndex].children().length() - 1] += parentValue;
                root.children()[childIndex].children()[root.children()[childIndex].children().length() - 1] += parentName;

            }
            childIndex++;
        }
    }
    parentIndex++;
}
logger.info("XMLMSG : " + root);
return root;

}
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to stop the End-Of-Segment 0D jhuey Support 0 09-05-2008 12:51 PM
end of segment characters jswaff Support 9 06-09-2008 08:46 AM
Replacing a segment in HL7 ASIF Support 0 02-25-2008 05:09 AM
Removing BTS segment tooolman Development 1 12-06-2007 12:18 PM
PV1 segment is980491 Support 4 01-20-2007 12:10 PM


All times are GMT -8. The time now is 11:56 PM.


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