From 9497029a15e945fa632b1c67431c398c7316bc46 Mon Sep 17 00:00:00 2001 From: Javier Castillo-Arnemann Date: Tue, 4 Jun 2024 13:10:28 -0700 Subject: [PATCH] update reference date docs --- mapping_functions.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mapping_functions.md b/mapping_functions.md index 40da55e..3ecff06 100644 --- a/mapping_functions.md +++ b/mapping_functions.md @@ -66,7 +66,12 @@ A detailed index of all standard functions can be viewed below in the [Standard ### Dealing with Dates -As of version 2.1 of the [MoHCCN Data Model](https://www.marathonofhopecancercentres.ca/docs/default-source/policies-and-guidelines/clinical-data-model-v2.1/mohccn-clinical-data-model-release-notes_sep2023.pdf?Status=Master&sfvrsn=19ece028_3), dates need to be converted into date intervals relative to the earliest date of diagnosis. Support for this has been incorporated into clinical_ETL_code v.2.0.0. In order to convert dates to date intervals, a `reference_date` must be provided in the `manifest.yml`. This can be an absolute date, or a function to calculate a date based on the input date, e.g. `earliest_date(Donor.date_resolution, PrimaryDiagnosis.date_of_diagnosis)`. In the mapping csv, the in-built `date_interval()` mapping function can be used to calculate the appropriate date interval information for any date-type field. e.g.: +As of version 2.1 of the [MoHCCN Data Model](https://www.marathonofhopecancercentres.ca/docs/default-source/policies-and-guidelines/clinical-data-model-v2.1/mohccn-clinical-data-model-release-notes_sep2023.pdf?Status=Master&sfvrsn=19ece028_3), dates need to be converted into date intervals relative to the earliest date of diagnosis. Support for this has been incorporated into clinical_ETL_code v.2.0.0. In order to convert dates to date intervals, a `reference_date` must be provided in the `manifest.yml`, which should be the patient's first date of diagnosis. You can assign the first age of diagnosis with: +```commandline +reference_date: earliest_date(Donor.date_resolution, PrimaryDiagnosis.date_of_diagnosis) +``` + +In the mapping csv, the in-built `date_interval()mapping function can be used to calculate the appropriate date interval information for any date-type field. e.g.: ```commandline DONOR.INDEX.date_of_birth, {date_interval(Donor.date_of_birth)}