Summary

This command creates a new form underneath the “parent” form. The form will be placed at the location as programmed in the forms template tab.

Table of Contents


Attributes

  • none

Parameters

  • parent – (string) This property is a path to the parent form under which this form will get created. See notes below regarding setting the parent as the record level.
  • type – (string) This property indicates the form type for the form that is to be created.
  • name – (string) This property sets the name of the new form.
  • alias – (string) This property sets the alias of the new form.
  • allowDuplicates – (string) If this property is set to true, duplicates of the form will be created. (By default, the property is false. To determine if a form already exists the alias is used if set, else the type is used.)
  • sequence – (number) If this property is set with a value, the form will be inserted at the specified form sequence.


Note: on usage of the parent parameter: if you are attempting to create the form on the record level (no parent form), you MUST use the record command instead of attempting to use a path. 
Example:
<s:parent>
<s:record/>
</s:parent>


Note: on usage of allowDuplicates: the default for this property is set to false. So by default it will not allow duplicates to be created. For it to be enabled, you must present the property so that it returns a true value. If you do not have a condition to base this on, you can simply use:
<s:allowDuplicates>
     <s:eq>
         <s:number value="1"/>
         <s:number value="1"/>
    </s:eq>
</s:allowDuplicates>

The value of the eq tag results in a true being passed to the allowDuplicates property.


Additional Note on usage of allowDuplicates: When using this parameter, it is recommended that shouldReconcile='false' be added. Otherwise, unwanted duplicate forms may be created at reconcile. 


Note: usage of the sequenceparameter:
  • Each createForm command does not know about any other forms that may be created before or after.
  • Not providing a sequence number will mean that the form will be placed last in line (i.e. highest sequence).
  • Forms cannot be created without a sequence number or sorting will not work, so one will be assigned by eClinical if it is not explicitly provided using the parameter.
  • Sequence numbers should be assigned incrementally.
  • The sequence number should be defined for all steps of a single script, if used in any portion of that script.



Example

<script scriptId="pregform">
    <body>
        <s:if>
            <s:and>
                <s:isSet/>
                <s:eq>
                    <s:numberPath path="/v01/demog.dmchild:value"/>
                    <s:number value="0"/>
                </s:eq>
            </s:and>
            <s:list>
            
                <s:createForm>
                    <s:parent>
                        <s:form path="/v01"/>
                    </s:parent>
                    <s:type>
                        <s:string value="pregser"/>
                    </s:type>
                    <s:alias>
                        <s:string value="pregser1v"/>
                    </s:alias>
                    <s:sequence>
                         <s:number value="12"/>
                    </s:sequence>
                </s:createForm>
                <s:createForm>
                    <s:parent>
                        <s:form path="/final"/>
                    </s:parent>
                    <s:type>
                        <s:string value="pregser"/>
                    </s:type>
                    <s:alias>
                        <s:string value="pregserfin"/>
                    </s:alias>
                    <s:sequence>
                         <s:number value="13"/>
                    </s:sequence>
                </s:createForm>
                
            </s:list>
        </s:if>
    </body>
    <target typeId="dmchild" when="after" shouldReconcile='true'/>
</script>

Note: You can also use createForm for those forms that occur at dynamic visits by setting a blank form path for the parent parameter. Please see the following example. 

Example

<script scriptId="createMarkers">
    <body>
        <s:if>
            <s:and>
                <s:isSet/>
                <s:contains>
                    <s:question path=".bioMarkers"/>
                    <s:string value="CgA"/>
                </s:contains>
            </s:and>
            
                <s:createForm>
                    <s:parent>
                        <s:form path=""/>
                    </s:parent>
                    <s:type>
                        <s:string value="bioCgA"/>
                    </s:type>
                </s:createForm>
                
        </s:if>
         <s:if>
            <s:and>
                <s:isSet/>
                <s:contains>
                    <s:question path=".bioMarkers"/>
                    <s:string value="CgB"/>
                </s:contains>
            </s:and>
            
                <s:createForm>
                    <s:parent>
                        <s:form path=""/>
                    </s:parent>
                    <s:type>
                        <s:string value="bioCgB"/>
                    </s:type>
                </s:createForm>
                
        </s:if>
    </body>
    <target typeId="dmchild" when="after" shouldReconcile='true'/>
</script>



Need more help?

Please visit the Fountayn Contact Information page.