Summary

This article covers the concat command. 


Description

This command concatenates all the string arguments into a single string. This is useful for building alert text that contains variables or building the content of an email that pulls information from an eCRF. If one of your arguments is not a string, you can use the toString command to force that value to a string so that it can be passed to the concat command.

Attributes

  • none

Parameters

  • two or more string commands


Note: When using the concat in an email trigger, you can use "\n" to create new lines in the email which can provide some basic formatting within the body of the email.



Basic Example

<script scriptId="consentEmailTrigger">
    <body>
        <s:if>
            <s:isSet>
                <s:question>
                    <s:question path=".consent"/>
                </s:question>
            </s:isSet>
            <s:email>
                <s:to>                    
        <s:string value="emailtriggers@fountayn.com"/>
                </s:to>
                <s:from>
                    <s:string value="no-reply@fountayn.com"/>
                </s:from>
                <s:subject>

                    <s:concat>
                        <s:string value="Phase III 1234 - Site "/>
                        <s:toolName/>
                        <s:string value=" - Subject "/>
                        <s:stringPath path="/baseline/info.patnum:value"/>
                        <s:string value=" - Consented"/>
                    </s:concat>

                </s:subject>
                <s:body>

                    <s:concat>
                        <s:string value="Study: Phase III 1234\nTo: Sponsor\n
                        Phone: +1 555-111-2222\nFax: +1 555-111-3333\n\n
                        Phase III - Sample Study\n\n"/>
                        <s:string value="Site "/>
                        <s:toolName/>
                        <s:string value=" - Subject "/>
                        <s:stringPath path="/baseline/info.patnum:value"/>
                        <s:string value=" ("/>
                        <s:stringPath path="/baseline/info.patinit:value"/>
                        <s:string value=") was consented.\n\nConsent Date: "/>
                        <s:toString>
                            <s:toDate>
                                <s:stringPath path="/baseline/info.consent:value"/>
                                <s:string value="dd/MMM/yyyy" />
                            </s:toDate>
                            <s:string value="dd/MMM/yyyy" />
                        </s:toString>
                    </s:concat>

                </s:body>
            </s:email>
        </s:if>
    </body>
    <target typeId="info" when="after" shouldReconcile='false' />
</script>

Advanced Example

<script scriptId="absVal">
    <body>
        <s:alert>
            <s:expression>
                <s:or>
                    <s:not>
                        <s:isSet>
                            <s:question>
                                <s:question path=".hudt"/>
                            </s:question>
                        </s:isSet>
                    </s:not>
                    <s:not>
                        <s:isSet>
                            <s:question>
                                <s:question path=".hutime"/>
                            </s:question>
                        </s:isSet>
                    </s:not>
                    <s:not>
                        <s:isSet>
                            <s:question>
                                <s:question path=".fcon1dt"/>
                            </s:question>
                        </s:isSet>
                    </s:not>
                    <s:not>
                        <s:isSet>
                            <s:question>
                                <s:question path=".fcon1time"/>
                            </s:question>
                        </s:isSet>
                    </s:not>
                    <s:lte>
                        <s:abs>
                            <s:dateDiff unit="minute" method="integer">
                                <s:from>
                                    <s:toDate>
                                    
                                        <s:concat>
                                            <s:toString>
                                                <s:datePath type="date" path=".hudt:value"/>
                                                <s:string value="MM/dd/yyyy"/>
                                            </s:toString>
                                            <s:string value=" " />
                                            <s:toString>
                                                <s:datePath type="date" path=".hutime:value"/>
                                                <s:string value="HH:mm"/>
                                            </s:toString>
                                        </s:concat>
                                        
                                        <s:string value="MM/dd/yyyy HH:mm" />
                                    </s:toDate>
                                </s:from>
                                <s:to>
                                    <s:toDate>
                                    
                                        <s:concat>
                                            <s:toString>
                                                <s:datePath type="date" path=".fcon1dt:value"/>
                                                <s:string value="MM/dd/yyyy"/>
                                            </s:toString>
                                            <s:string value=" " />
                                            <s:toString>
                                                <s:datePath type="date" path=".fcon1time:value"/>
                                                <s:string value="HH:mm"/>
                                            </s:toString>
                                        </s:concat>
                                        
                                        <s:string value="MM/dd/yyyy HH:mm" />
                                    </s:toDate>
                                </s:to>
                            </s:dateDiff>
                        </s:abs>
                        <s:number value="240"/>
                    </s:lte>
                </s:or>
            </s:expression>
            <s:correction>
                <s:string value="optional"/>
            </s:correction>
            <s:text>
                <s:string value="The absolute difference between the 'Holter Monitor 
                Hook-Up' and the 'First Contrast Injection' should be no more than 4 
                hours. Please verify."/>
            </s:text>
        </s:alert>
    </body>
    <target typeId="fcon1time" when="preprocess" shouldReconcile='true' />
    <dependent path="/summary/ecgReport[n].hudt"/>
    <dependent path="/summary/ecgReport[n].hutime"/>
    <dependent path="/summary/ecgReport[n].fcon1dt"/>
</script>

Need more help?

Please visit the Fountayn Contact Information page.