Summary

This article covers a script example for converting date of birth. 

Table of Contents


Description

This script is written to convert dates within the import file to the date format that is used in the casebook of the study. This script is much like the convertCollectionDt script except that this script is only used for comparison. Since this field (date of birth) is used to determine the record to import into, it has to match the study format exactly. The script converts a string to a specific format and then uses the “upper” command to uppercase the month portion of the date so that it matches the format in the casebook. There is also a script in the casebook on the date of birth which forces that date to uppercase as well so these will always match. That script runs when the demography form is saved.

Script

<script scriptId="convertDob">
    <body>
        <s:upper>
            <s:toString>
                <s:toDate>
                    <s:import inputPath="7"/>
                    <s:string value="dd-MMM-yyyy"/>
                </s:toDate>
                <s:string value="dd/MMM/yyyy"/>
            </s:toString>
        </s:upper>
    </body>
</script>





Need more help?

Please visit the Fountayn Contact Information page.