This topic contains 4 replies, has 3 voices, and was last updated by  lev 4 years, 3 months ago.

Mutiple request in a single Message

  • Hi,

    I successfully sent single request in a message but facing some problem in coding part to send multiple observation request(OBR) in a single message in an order. In order to implement this am using these methods nodeValue() , nodeName() and the # operator , but am not getting message in this order ….

    |OBR|1|
    |DG1|1|
    |OBX|1|
    |OBR|2|
    |DG1|1|
    |DG1|2|
    |OBR|3|
    |DG1|1|
    |OBX|1|

    Please help me out to get messages in order.

    Any other Reference link , sample code or video will be appreciated.

    I guess you need to use a for loop for each repeating segment. Create a function for MapOBR and for other repeating segments and use a for loop to get the values.

    Have a look at the NK1 sample on wiki;

    http://wiki.interfaceware.com/214.html

    You have to create in Segments Grammar, in vmd file, repeating Group made of single OBR segment, followed by repeating DG1 segment, and followed by single (or repeating) OBX segment.

    After replacing your current vmd file in Translator project, this new vmd file will allow you to create respective correct looping in Lua script.

    Hi … Thanks for response …

    I have already created the segments grammar in vmd file for repeating groups , am getting multiple request in a message but not in an “order”.
    Means based on checking the condition(ex: DG1 for respective OBR segments) how to map the segment values ? am using two FOR loop for
    DG1 and OBR segments to retreive multiple values but problem is only with ORDER.

    MSH|^~\&|
    PID|1|
    PV1|1|
    IN1|1|
    GT1|1|
    ORC|
    OBR|1|
    NTE|1|
    NTE|2|
    DG1|1|
    DG1|2|
    OBR|2|
    DG1|1|

    In this example the two DG1 segments is come under single OBR|1| segments , i am facing problem here … I am getting output as

    |OBR|1|
    |DG1|1|
    |OBR|2|
    |DG1|2|

    Can you please help me with sample scripting code.

    Hello Nayana,

    Possibly you have to mark DG1 segments as ‘repeating’. From here on it is hard to say without seeing your Translator project code, sample data, and vmd file. Thus, if I may suggest, please send this inquiry to support@interfaceware.com and Suport will gladly answer your question.

    Cheers,
    Lev.

You must be logged in to reply to this topic.