Summary

This article covers a script example of assigning IP kits based on subject randomization.

Table of Contents

TABLE OF CONTENTS


Description

This script triggers a subject inventory assignment according to the subject’s randomized treatment type, using the quantities configured in Inventory settings. In this example, the drugAssign command will execute if the Visit 2 question assingyn is answered Yes. If the conditions are met, inventory will be assigned and the kit number(s) will be written to the Visit 2 assignkits question.

Script

<script scriptId="assignDrugVisit2">
    <body>
        <s:if>
            <s:and>
                <s:eq>
                    <s:numberPath path=":id" />
                    <s:numberPath path="/visit2v.assignyn:id" />
                </s:eq>
                <s:isSet />
                <s:eq>
                    <s:stringPath path=".assignyn:value" />
                    <s:string value="Y"/>
                </s:eq>
            </s:and>
            <s:drugAssign description="Visit2">
                <s:question path="/visit2v.assignkits" />
            </s:drugAssign>
        </s:if>
    </body>
    <target action="update" shouldReconcile="false" typeId="assignyn" when="after"/>
</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.