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

Calculation

Dear All;

Im looking on how can i make the age field auto-calculated and then i found this link: http://en.wikibooks.org/wiki/OpenClinica_User_Manual/AgeField and it works fine if all the concerned fields (visit date, date of birth, age) are in one tab only. My question is how can i used this auto-calculated features if the fields used are in 3 different tabs?
e.g.
Visit Date in Tab 1
Date of Birth in Tab 2
Age in Tab 3

Did somebody else there that did it before? or someone knew how to to do this?

Any help is very much appreciated.


Thank you and best regards,
George

Comments

  • bcp075bcp075 Posts: 37
    Dear All;

    Im looking on how can i make the age field auto-calculated and then i found this link: http://en.wikibooks.org/wiki/OpenClinica_User_Manual/AgeField and it works fine if all the concerned fields (visit date, date of birth, age) are in one tab only. My question is how can i used this auto-calculated features if the fields used are in 3 different tabs?
    e.g.
    Visit Date in Tab 1
    Date of Birth in Tab 2
    Age in Tab 3

    Did somebody else there that did it before? or someone knew how to to do this?

    Any help is very much appreciated.


    Thank you and best regards,
    George
  • GerbenRienkGerbenRienk Posts: 810 ✭✭✭
    Hello George,

    The javascript does the calculating, so the data with which to calculate should all be available to the script. If the data is entered on a different section, or a different CRF, you can “copy” it to the section with the Age-item, using an InsertAction. Do this for both the VisitDate and the DateOfBirth and you’re good to go.

    In case you’re not familiar with InsertActions I attach an example XML-file
    Open it in any XML-editor, for example notepad++ (http://notepad-plus-plus.org/)
    Find the OID of your VisitDate (see for help http://www.trialdatasolutions.com/tds/howto/findingoids.jsp or http://en.wikibooks.org/wiki/OpenClinica_User_Manual/FindingOIDs)
    Replace in the XML-file every occurrence of [Source1_Item_OID] with the actual OID, preferably by doing a global search-and-replace
    Find the OID of the item you want to copy the VisitDate into
    Replace in the XML-file every occurrence of [Target1_Item_OID] with the this OID
    Do the same for the DoB, but now with Source2 and Target2

    Hope this helps,

    Gerben Rienk
    http://www.trialdatasolutions.com

    Note1: if you want, you can leave out the part “[CRF_Version_OID].[Item_Group_OID].” In the Target, but I like to keep it in, because if you have many Rules in your Study, you will want to order or filter them by CRF. Plus it gives you the option to run all Rules for a CRF.
    Note2: if for example the DateOfBirth item is on a different CRF, this CRF must be in the same Event as the CRF with the calculation. The part with “DestinationProperty OID="[Target1_Item_OID]"” must now be modified to include the CRF_OID and the Item_Group_OID of this target. If any data is given for the source_item, the DoB, then the CRF with the calculation will be created automatically: very neat indeed!


    Van: [email protected] [mailto:[email protected]] Namens Tony George
    Verzonden: maandag 21 januari 2013 7:50
    Aan: UserOC; [email protected]
    CC: [email protected]
    Onderwerp: [Users] Calculation

    Dear All;

    Im looking on how can i make the age field auto-calculated and then i found this link: http://en.wikibooks.org/wiki/OpenClinica_User_Manual/AgeField and it works fine if all the concerned fields (visit date, date of birth, age) are in one tab only. My question is how can i used this auto-calculated features if the fields used are in 3 different tabs?
    e.g.
    Visit Date in Tab 1
    Date of Birth in Tab 2
    Age in Tab 3

    Did somebody else there that did it before? or someone knew how to to do this?

    Any help is very much appreciated.


    Thank you and best regards,
    George


    Attachments:
    InsertActionExample.zip 915 bytes
This discussion has been closed.