Summary

This script is an email trigger that evaluates the target (rate) and if it is less than or equal to 40 it will send out an email. It determines which environment the script is running on (Staging or Production) and sends out the email to that predetermined list. Staging includes the design/test/approve environment whereas Production is the live/production environment. Please consider the existence of training sites on production. 


Note: -'shouldReconcile' is set to ***false*** so that the script will not be evaluated again upon use of the reconcile utility. This script will execute only when data entry is done. 


Script

<script scriptId="emailTrigger">
    <body>
        <s:if>
            <s:lte>
                <s:numberPath path=".rate:value"/>
                <s:number value="40"/>
            </s:lte>
            <s:email>
                <s:to>
                    <s:if>
                        <s:eq>
                            <s:environment/>
                            <s:string value="Staging"/>
                        </s:eq>
                        <s:list>
                            <s:string value="emailtriggers@fountayn.com"/>
                            <s:string value="test1@clientAddress.net"/>
                        </s:list>
                        <s:list>
                            <s:string value="emailtriggers@fountayn.com"/>
                            <s:string value="test1@clientAddress.net"/>
                            <s:string value="test2@clientAddress.net"/>
                            <s:string value="test3@clientAddress.net"/>
                        </s:list>
                    </s:if>
                </s:to>
                <s:from>
                    <s:string value="no-reply@fountayn.com"/>
                </s:from>
                <s:subject>
                    <s:string value="Heart Rate <= 40 bpm"/>
                    </s:subject>
                    <s:body>
                        <s:concat>
                            <s:string value="Patient #: "/>
                            <s:stringPath path="/registration.patID:value"/>
                            <s:string value=" - Heart Rate <= 40 bpm"/>
                        </s:concat>
                    </s:body>
            </s:email>
        </s:if>
    </body>
    <target typeId="rate" action="update" shouldReconcile='false' when="after"/>
</script>



Need more help?

Please visit the Fountayn Contact Information page.