Summary

This article covers the alert command.


Description

This command assigns an alert to the target if the expression is not true. If the correction parameter is optional, it will trigger a red alert. If the correction parameter is required, it will trigger a black alert.


Attributes

  • none

Parameters

  • expression – any combination of logic which results in a boolean output
  • correction – values are a string with the value of ‘required’ or ‘optional’
  • text – string values or concatenated string values


Note: Do NOT place logical checks that should be used to evaluate the alert outside of the “expression” tags. If an alert is triggered and then those evaluations outside of the expression cause the expression not to be evaluated again, the alert will never clear. The only reasonable check outside of the expression tags would be an :id check where the alert should only fire on specific instances of a questionType that appears in multiple locations.


Note: For alert scripts the ‘when’ must be set to preprocess.


Example

<script scriptId="audioDtCk2">
    <body>
    
        <s:alert>
            <s:expression>
                <s:or>
                    <s:not>
                        <s:isSet/>
                    </s:not>
                    <s:not>
                        <s:isSet>
                            <s:question>
                                <s:question path="/screening/ds.consdt_"/>
                            </s:question>
                        </s:isSet>
                    </s:not>
                    <s:gte>
                        <s:datePath path=":value"/>
                        <s:addDate>
                            <s:date>
                                <s:datePath path="/screening/ds.consdt_:value"/>
                            </s:date>
                            <s:days>
                                <s:number value="-7"/>
                            </s:days>
                        </s:addDate>
                    </s:gte>
                </s:or>
            </s:expression>
            <s:correction>
                <s:string value="optional"/>
            </s:correction>
            <s:text>
                <s:string value="Chest X-Ray date is more than 7 days prior to the date of consent.  Please clarify."/>
            </s:text>
        </s:alert>
        
    </body>
    <target typeId="evdt2_" when="preprocess" shouldReconcile='true' />
    <dependent path="/screening/ds.consdt_"/>
</script>

Need more help?

Please visit the Fountayn Contact Information page.