Table of Contents
In Castor CDMS, you can't copy a whole visit with a single click. There are two ways to duplicate a visit:
- Option 1 (recommended): Create a new visit and copy the forms into it one by one. This gives you the most control over variable names and dependencies.
- Option 2: Export the visit structure and import it again. This is faster for visits with many forms, but you will need to rename the original visit first and update the variable names by hand afterwards.
Option 1: Create a new visit and copy the forms (recommended)
This is usually the most practical method. When you copy each form, Castor can add or replace prefixes and suffixes in the variable names automatically, for example changing v1_ to v2_. It also lets you choose how dependencies are copied.
Step 1: Create the new visit
- Go to Study design → Structure.
- On the Visits tab, click Add and select Visit.
- Enter a name for the new visit (for example, Visit 2) and choose its position.
Step 2: Copy each form from the original visit
- On the Visits tab, expand the original visit.
- Click the three dots (⋮) at the right of the form you want to copy.
- Click Copy form.
- In the Copy form window, fill in the details:
- Copy to: Select Visit.
- Location: Select the new visit you created.
- Position: Choose where to place the form in the new visit.
- New form name: Enter a unique name for the form.
-
Prefix and/or suffix: Add a prefix or suffix, or replace an existing one (for example, replace
v1_withv2_), so the variable names stay unique and descriptive. - Copy Calculation, Summary, Link and QR code fields? and Copy dependencies?: Choose Yes, and refer them to copied fields if the copied fields should refer to the fields in the new visit. Choose Yes, and refer them to original fields if they should keep referring to the fields in the original visit.
- Copy domain variable names: Choose whether to copy the domain variable names as well.
- Click Copy.
- Repeat these steps for each form in the visit.
For a full explanation of every option in the Copy form window, see Copy Forms in CDMS.
Option 2: Export and import the visit structure
If a visit has many forms, you can duplicate the whole visit at once by exporting its structure as an XML file and importing it again.
Step 1: Export the visit
- Go to Study design → Forms.
- Click Export.
- Select the visit you want to export.
- Click Export to download the structure as an XML file.
Step 2: Rename the original visit
Visit names must be unique. The exported file contains the original visit name, so you can't import it while a visit with that name still exists in your study. If you try, you will see this error:
The import file includes one or more visits that already exist in your study ("First Study Visit"). Please update the visit name(s) before proceeding with the import.
To avoid this, rename the original visit before you import:
- Go to Study design → Structure.
- On the Visits tab, click the three dots (⋮) at the right of the original visit.
- Click Edit visit details and give the visit a new name, for example change First Study Visit to Visit 1.
- Save your changes.
Step 3: Import the visit
- Go to Study design → Forms and click Import.
- Click Choose file and select the XML file you exported.
- Click Upload.
- Select the position for the imported visit from the dropdown menu.
- Click Continue import.
The imported visit keeps the original name from the file. Rename it if needed, for example to Visit 2, the same way as in Step 2.
Step 4: Update the variable names
Variable names must be unique across the study. If the imported structure contains variable names that already exist, Castor resolves the conflict automatically by adding a number to the end of the name. For example, gender becomes gender_1, and the next copy becomes gender_2.
Review the variable names in the imported forms and rename them if you want them to be more descriptive, for example v2_gender instead of gender_1.
After importing, check that calculations and dependencies in the new visit refer to the correct variable names.
For more details, see Export the form structure in CDMS and Import the form structure in CDMS.