We hope you'll join us for our 4/23 webinar on using data tables to apply reference ranges and AE codes in OC4. For more information and to register, visit https://register.gotowebinar.com/register/2882170018956684555

Concatenation of two items

Dear all,
I'm trying to do a simple concatenation of two text items using
the 'RESPONSE_VALUES_OR_CALCULATIONS' crf's column.

I did not find any suggestion that says opc allows the use of concatenation
but I was wondering if there is a workaround to reach the same result.

I tried with the 'decode' function but it seems it is no possible
use it if the calculated item is in a group and the source in a different one.

Did someone already meet the problem and can share the solution?
Any other suggestion?

Thanks in advance,

Alfonso Pastori
Senior Clinical Systems Analyst
CLIOSS s.r.l.
CLInical Organization for Strategies & Solutions
V.le Pasteur, 10 - 20014 Nerviano (MI)

Comments

  • alfopcliossalfopclioss Posts: 37
    Dear all,
    I'm trying to do a simple concatenation of two text items using
    the 'RESPONSE_VALUES_OR_CALCULATIONS' crf's column.

    I did not find any suggestion that says opc allows the use of concatenation
    but I was wondering if there is a workaround to reach the same result.

    I tried with the 'decode' function but it seems it is no possible
    use it if the calculated item is in a group and the source in a different one.

    Did someone already meet the problem and can share the solution?
    Any other suggestion?

    Thanks in advance,

    Alfonso Pastori
    Senior Clinical Systems Analyst
    CLIOSS s.r.l.
    CLInical Organization for Strategies & Solutions
    V.le Pasteur, 10 - 20014 Nerviano (MI)
  • GerbenRienkGerbenRienk Posts: 803 ✭✭✭
    Hello Alfonso,
    You could try to do this with javascript. I do not see a method to attach a file to the forum-reply, so I will copy the text. 
    In the right_item_text of item 1 and 2 you put: <div ID="Item1"></div> and <div ID="Item2"></div>
    And in the concatenation-item comes:
    <div ID="ConcatResult"></div>
    <script src="includes/jmesa/jquery.min.js"></script>
    <script>
    $.noConflict();
    jQuery(document).ready(function($) {
    var inpItem1 = $("#Item1").parent().parent().find("input");
    var inpItem2 = $("#Item2").parent().parent().find("input");
    var inpConcatResult = $("#ConcatResult").parent().parent().find("input");

    function ConcatenateItems(){
     var Total = inpItem1.val().concat(inpItem2.val()) ;
     
     if (inpConcatResult.val() != Total){
      inpConcatResult.val(Total);
      inpConcatResult.change();
     }
    };
    inpItem1.keyup(function(){
     ConcatenateItems();
     });
    inpItem2.keyup(function(){
     ConcatenateItems();
     });
    ConcatenateItems();
    })
    </script>

    Hope this helps,
    Gerben Rienk
    http://www.trialdatasolutions.com
  • alfopcliossalfopclioss Posts: 37
    via Email
    Hi Garben,
    thanks for the replay.
    I will keep it into account for the future.

    Thanks again, regards
    Alfonso.
This discussion has been closed.