Summary

This article covers a script example of checking if IP assignment can successfully complete.

Table of Contents


Description

This example shows how the drugAssignCheck command can be used in an alert script to determine if a drug assignment can successfully complete. If it cannot complete, the specified alert text will display.

Script

<script scriptId="drugAssignCheckVisit2">
    <body>
        <s:alert>
            <s:expression>
                <s:or>
                    <s:ne>
                        <s:numberPath path=":id" />
                        <s:numberPath path="/visit2v.assignyn:id" />
                    </s:ne>
                    <s:not>
                        <s:isSet />
                    </s:not>
                    <s:ne>
                        <s:stringPath path=".assignyn:value" />
                        <s:string value="Y"/>
                    </s:ne>
                    <s:eq>
                        <s:drugAssignCheck>
                            <s:question path="/visit2v.assignkits" />
                        </s:drugAssignCheck>
                        <s:string value="" />
                    </s:eq>
                </s:or>
            </s:expression>
            <s:correction>
                <s:string value="optional"/>
            </s:correction>
            <s:text>
                <s:concat>
                    <s:string value="Drug assignment cannot complete. Please check stock and configuration. (Eror: "/>
                    <s:drugAssignCheck>
                        <s:question path="/visit2v.assignkits" />
                    </s:drugAssignCheck>
                    <s:string value=")."/>
                </s:concat>
            </s:text>
        </s:alert>
    </body>
    <target action="update" typeId="assignyn" when="preprocess"/>
    <dependent path="/visit2v.assignkits"/>
</script>

See Triggering Inventory Assignment with a Script for important information and considerations when using scripts to execute a Drug Assignment. 



Need more help?

Please visit the Fountayn Contact Information page.