18 | | 1. All cases that has a value for the INCA_A030DiaDat annotation should be update to: |
19 | | `ReferenceDate=INCA_A030DiaDat` and `ReferenceDateSource=IncaDiagnosisDate`. |
20 | | 2. All cases that has at least one Specimen or !NoSpecimen item with a creation date |
21 | | should be updated to `ReferenceDate=earliest created date` and `ReferenceDateSource=SamplingDate`. |
22 | | See below for a recipe. |
23 | | 3. Remaining cases that has a value for the !ConsentDate annotation should be updated to: |
24 | | `ReferenceDate=ConsentDate` and `ReferenceDateSource=ConsentDate`. |
25 | | 4. All remaining cases should be updated to: |
26 | | `ReferenceDate=Registered` and `ReferenceDateSource=RegistrationDate`. |
27 | | |
28 | | 1, 3 and 4 can be done with a simple export/import operation with the help of a spreadsheet to |
29 | | fill in the !ReferenceDateSource value. |
30 | | |
31 | | '''Recipe for step 2''' |
32 | | |
33 | | a. Create a new item list with member type: Sample. |
34 | | b. Add the following synchronization filters: |
35 | | * Parent Sample that matches filter must exist: |
36 | | `itemSubtype = 'Case' AND {ReferenceDateSource} = null` |
37 | | * Sample must match filter: `creationEvent.eventDate != AND itemSubtype IN ('NoSpecimen', 'Specimen')` |
38 | | c. Sync the item list. This will create a list containing all Specimen/!NoSpecimen items that has |
39 | | a parent Case without a !ReferenceDate. |
40 | | d. Go to the Samples list page and make sure the following columns are displayed: |
41 | | * Parent items |
42 | | * Created |
43 | | * Item list |
44 | | e. Filter the samples with the item list created in step a. |
45 | | f. '''IMPORTANT!! ''' Sort the samples by "Created" date in ascending order. This allows the annotation import in step i to select the earliest date for each item. |
46 | | g. Export the "Parent items" and "Created" column. |
47 | | h. In a spreadsheet, add third column for `ReferenceDateSource` and fill all rows with `SamplingDate`. |
48 | | i. Use the annotation importer to update the `ReferenceDate` and `ReferenceDateSource` annotations. The "Parent items" column maps to "Name". |
49 | | '''IMPORTANT!! ''' Make sure that the error handling option "Too many values" is set to "Crop". |
50 | | j. Verify that the import worked by re-syncing the item list created in step 1. It should should now be empty. |